comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
null | // SPDX-License-Identifier: UNLICENSED
// Taken from https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol
pragma solidity ^0.7.0;
library BytesUtil {
function slice(
bytes memory _bytes,
uint _start,
uint _length
)
internal
pure
returns (bytes memory)
{
}
function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {
}
function toUint8(bytes memory _bytes, uint _start) internal pure returns (uint8) {
}
function toUint16(bytes memory _bytes, uint _start) internal pure returns (uint16) {
require(<FILL_ME>)
uint16 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x2), _start))
}
return tempUint;
}
function toUint24(bytes memory _bytes, uint _start) internal pure returns (uint24) {
}
function toUint32(bytes memory _bytes, uint _start) internal pure returns (uint32) {
}
function toUint64(bytes memory _bytes, uint _start) internal pure returns (uint64) {
}
function toUint96(bytes memory _bytes, uint _start) internal pure returns (uint96) {
}
function toUint128(bytes memory _bytes, uint _start) internal pure returns (uint128) {
}
function toUint(bytes memory _bytes, uint _start) internal pure returns (uint256) {
}
function toBytes4(bytes memory _bytes, uint _start) internal pure returns (bytes4) {
}
function toBytes32(bytes memory _bytes, uint _start) internal pure returns (bytes32) {
}
function fastSHA256(
bytes memory data
)
internal
view
returns (bytes32)
{
}
}
| _bytes.length>=(_start+2) | 165,648 | _bytes.length>=(_start+2) |
null | // SPDX-License-Identifier: UNLICENSED
// Taken from https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol
pragma solidity ^0.7.0;
library BytesUtil {
function slice(
bytes memory _bytes,
uint _start,
uint _length
)
internal
pure
returns (bytes memory)
{
}
function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {
}
function toUint8(bytes memory _bytes, uint _start) internal pure returns (uint8) {
}
function toUint16(bytes memory _bytes, uint _start) internal pure returns (uint16) {
}
function toUint24(bytes memory _bytes, uint _start) internal pure returns (uint24) {
require(<FILL_ME>)
uint24 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x3), _start))
}
return tempUint;
}
function toUint32(bytes memory _bytes, uint _start) internal pure returns (uint32) {
}
function toUint64(bytes memory _bytes, uint _start) internal pure returns (uint64) {
}
function toUint96(bytes memory _bytes, uint _start) internal pure returns (uint96) {
}
function toUint128(bytes memory _bytes, uint _start) internal pure returns (uint128) {
}
function toUint(bytes memory _bytes, uint _start) internal pure returns (uint256) {
}
function toBytes4(bytes memory _bytes, uint _start) internal pure returns (bytes4) {
}
function toBytes32(bytes memory _bytes, uint _start) internal pure returns (bytes32) {
}
function fastSHA256(
bytes memory data
)
internal
view
returns (bytes32)
{
}
}
| _bytes.length>=(_start+3) | 165,648 | _bytes.length>=(_start+3) |
null | // SPDX-License-Identifier: UNLICENSED
// Taken from https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol
pragma solidity ^0.7.0;
library BytesUtil {
function slice(
bytes memory _bytes,
uint _start,
uint _length
)
internal
pure
returns (bytes memory)
{
}
function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {
}
function toUint8(bytes memory _bytes, uint _start) internal pure returns (uint8) {
}
function toUint16(bytes memory _bytes, uint _start) internal pure returns (uint16) {
}
function toUint24(bytes memory _bytes, uint _start) internal pure returns (uint24) {
}
function toUint32(bytes memory _bytes, uint _start) internal pure returns (uint32) {
require(<FILL_ME>)
uint32 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x4), _start))
}
return tempUint;
}
function toUint64(bytes memory _bytes, uint _start) internal pure returns (uint64) {
}
function toUint96(bytes memory _bytes, uint _start) internal pure returns (uint96) {
}
function toUint128(bytes memory _bytes, uint _start) internal pure returns (uint128) {
}
function toUint(bytes memory _bytes, uint _start) internal pure returns (uint256) {
}
function toBytes4(bytes memory _bytes, uint _start) internal pure returns (bytes4) {
}
function toBytes32(bytes memory _bytes, uint _start) internal pure returns (bytes32) {
}
function fastSHA256(
bytes memory data
)
internal
view
returns (bytes32)
{
}
}
| _bytes.length>=(_start+4) | 165,648 | _bytes.length>=(_start+4) |
null | // SPDX-License-Identifier: UNLICENSED
// Taken from https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol
pragma solidity ^0.7.0;
library BytesUtil {
function slice(
bytes memory _bytes,
uint _start,
uint _length
)
internal
pure
returns (bytes memory)
{
}
function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {
}
function toUint8(bytes memory _bytes, uint _start) internal pure returns (uint8) {
}
function toUint16(bytes memory _bytes, uint _start) internal pure returns (uint16) {
}
function toUint24(bytes memory _bytes, uint _start) internal pure returns (uint24) {
}
function toUint32(bytes memory _bytes, uint _start) internal pure returns (uint32) {
}
function toUint64(bytes memory _bytes, uint _start) internal pure returns (uint64) {
require(<FILL_ME>)
uint64 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x8), _start))
}
return tempUint;
}
function toUint96(bytes memory _bytes, uint _start) internal pure returns (uint96) {
}
function toUint128(bytes memory _bytes, uint _start) internal pure returns (uint128) {
}
function toUint(bytes memory _bytes, uint _start) internal pure returns (uint256) {
}
function toBytes4(bytes memory _bytes, uint _start) internal pure returns (bytes4) {
}
function toBytes32(bytes memory _bytes, uint _start) internal pure returns (bytes32) {
}
function fastSHA256(
bytes memory data
)
internal
view
returns (bytes32)
{
}
}
| _bytes.length>=(_start+8) | 165,648 | _bytes.length>=(_start+8) |
null | // SPDX-License-Identifier: UNLICENSED
// Taken from https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol
pragma solidity ^0.7.0;
library BytesUtil {
function slice(
bytes memory _bytes,
uint _start,
uint _length
)
internal
pure
returns (bytes memory)
{
}
function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {
}
function toUint8(bytes memory _bytes, uint _start) internal pure returns (uint8) {
}
function toUint16(bytes memory _bytes, uint _start) internal pure returns (uint16) {
}
function toUint24(bytes memory _bytes, uint _start) internal pure returns (uint24) {
}
function toUint32(bytes memory _bytes, uint _start) internal pure returns (uint32) {
}
function toUint64(bytes memory _bytes, uint _start) internal pure returns (uint64) {
}
function toUint96(bytes memory _bytes, uint _start) internal pure returns (uint96) {
require(<FILL_ME>)
uint96 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0xc), _start))
}
return tempUint;
}
function toUint128(bytes memory _bytes, uint _start) internal pure returns (uint128) {
}
function toUint(bytes memory _bytes, uint _start) internal pure returns (uint256) {
}
function toBytes4(bytes memory _bytes, uint _start) internal pure returns (bytes4) {
}
function toBytes32(bytes memory _bytes, uint _start) internal pure returns (bytes32) {
}
function fastSHA256(
bytes memory data
)
internal
view
returns (bytes32)
{
}
}
| _bytes.length>=(_start+12) | 165,648 | _bytes.length>=(_start+12) |
null | // SPDX-License-Identifier: UNLICENSED
// Taken from https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol
pragma solidity ^0.7.0;
library BytesUtil {
function slice(
bytes memory _bytes,
uint _start,
uint _length
)
internal
pure
returns (bytes memory)
{
}
function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {
}
function toUint8(bytes memory _bytes, uint _start) internal pure returns (uint8) {
}
function toUint16(bytes memory _bytes, uint _start) internal pure returns (uint16) {
}
function toUint24(bytes memory _bytes, uint _start) internal pure returns (uint24) {
}
function toUint32(bytes memory _bytes, uint _start) internal pure returns (uint32) {
}
function toUint64(bytes memory _bytes, uint _start) internal pure returns (uint64) {
}
function toUint96(bytes memory _bytes, uint _start) internal pure returns (uint96) {
}
function toUint128(bytes memory _bytes, uint _start) internal pure returns (uint128) {
require(<FILL_ME>)
uint128 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x10), _start))
}
return tempUint;
}
function toUint(bytes memory _bytes, uint _start) internal pure returns (uint256) {
}
function toBytes4(bytes memory _bytes, uint _start) internal pure returns (bytes4) {
}
function toBytes32(bytes memory _bytes, uint _start) internal pure returns (bytes32) {
}
function fastSHA256(
bytes memory data
)
internal
view
returns (bytes32)
{
}
}
| _bytes.length>=(_start+16) | 165,648 | _bytes.length>=(_start+16) |
null | // SPDX-License-Identifier: UNLICENSED
// Taken from https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol
pragma solidity ^0.7.0;
library BytesUtil {
function slice(
bytes memory _bytes,
uint _start,
uint _length
)
internal
pure
returns (bytes memory)
{
}
function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {
}
function toUint8(bytes memory _bytes, uint _start) internal pure returns (uint8) {
}
function toUint16(bytes memory _bytes, uint _start) internal pure returns (uint16) {
}
function toUint24(bytes memory _bytes, uint _start) internal pure returns (uint24) {
}
function toUint32(bytes memory _bytes, uint _start) internal pure returns (uint32) {
}
function toUint64(bytes memory _bytes, uint _start) internal pure returns (uint64) {
}
function toUint96(bytes memory _bytes, uint _start) internal pure returns (uint96) {
}
function toUint128(bytes memory _bytes, uint _start) internal pure returns (uint128) {
}
function toUint(bytes memory _bytes, uint _start) internal pure returns (uint256) {
require(<FILL_ME>)
uint256 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x20), _start))
}
return tempUint;
}
function toBytes4(bytes memory _bytes, uint _start) internal pure returns (bytes4) {
}
function toBytes32(bytes memory _bytes, uint _start) internal pure returns (bytes32) {
}
function fastSHA256(
bytes memory data
)
internal
view
returns (bytes32)
{
}
}
| _bytes.length>=(_start+32) | 165,648 | _bytes.length>=(_start+32) |
"Cannot mint more than are available" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;
import "@openzeppelin/[email protected]/token/ERC721/ERC721.sol";
import "@openzeppelin/[email protected]/access/Ownable.sol";
import "../DefaultOperatorFilterer.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
interface OLDCONTRACT {
function totalSupply() external view returns (uint256);
function ownerOf(uint256 _tokenId) external view returns (address);
}
contract Totemheads is ERC721, DefaultOperatorFilterer, Ownable, ReentrancyGuard {
using Strings for uint256;
bool paused = true;
bool presaleAirdropComplete = false;
uint256 internal maxSupply = 6969;
uint256 internal publicSupply = 6900; // (24 x 1/1's and 45 x promo)
uint256 internal nextTokenId = 1;
uint256 mintCost = 0.06 ether;
string baseURI = "https://lordcalder.com/totemheads/final/";
address BROKENDEPLOYMENT = 0x015B7aA92C5448B2062eAE4e2e50020180413a74;
address theDev = 0xa0270756B3a3E18AfA74dB7812367aF9E5e79BF3;
address theArt = 0x05a78085EBd9a5a4E6E94a5167480E106C1B6028;
address internal _owner;
constructor() ERC721("TotemheadsNFTs", "TotemheadsNFTs") {
}
modifier callerIsUser() {
}
function setCost(uint256 _cost) public onlyOwner {
}
function setTheDev(address _theDev) public onlyOwner {
}
function setTheArtist(address _theArt) public onlyOwner {
}
function totalSupply() public view returns (uint256) {
}
function getMaxSupply() public view returns (uint256) {
}
function getPublicMintSupply() public view returns (uint256) {
}
function _baseURI() internal view override returns (string memory) {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function isPaused() public view returns (bool) {
}
function togglePaused() public onlyOwner {
}
function mintPrice() public view returns (uint256) {
}
function initiateAirDrop() public onlyOwner {
}
function mint(address sendTo, uint256 howMany) public payable callerIsUser nonReentrant {
require(howMany > 0, "Cannot mint 0" );
if(msg.sender != _owner) {
require(paused == false,"Public mint is not live");
require(<FILL_ME>)
require(msg.value == (howMany * mintCost), "Not enough ETH");
sendTo = msg.sender;
} else {
require((totalSupply() + howMany) <= getMaxSupply(), "Cannot mint more than are available" );
}
for (uint256 i = 0; i < howMany; ++i) {
_safeMint(sendTo, nextTokenId);
nextTokenId += 1;
}
}
function withdraw() public payable onlyOwner nonReentrant {
}
function withdrawAll() public payable onlyOwner {
}
// The following functions are overrides required by Solidity.
function _burn(uint256 tokenId) internal override(ERC721) {
}
function tokenURI(uint256 _tokenId)
public
view
virtual
override(ERC721)
returns (string memory)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721)
returns (bool)
{
}
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
}
function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) {
}
function transferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
public
override
onlyAllowedOperator(from)
{
}
}
| (totalSupply()+howMany)<=getPublicMintSupply(),"Cannot mint more than are available" | 165,654 | (totalSupply()+howMany)<=getPublicMintSupply() |
"Not enough ETH" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;
import "@openzeppelin/[email protected]/token/ERC721/ERC721.sol";
import "@openzeppelin/[email protected]/access/Ownable.sol";
import "../DefaultOperatorFilterer.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
interface OLDCONTRACT {
function totalSupply() external view returns (uint256);
function ownerOf(uint256 _tokenId) external view returns (address);
}
contract Totemheads is ERC721, DefaultOperatorFilterer, Ownable, ReentrancyGuard {
using Strings for uint256;
bool paused = true;
bool presaleAirdropComplete = false;
uint256 internal maxSupply = 6969;
uint256 internal publicSupply = 6900; // (24 x 1/1's and 45 x promo)
uint256 internal nextTokenId = 1;
uint256 mintCost = 0.06 ether;
string baseURI = "https://lordcalder.com/totemheads/final/";
address BROKENDEPLOYMENT = 0x015B7aA92C5448B2062eAE4e2e50020180413a74;
address theDev = 0xa0270756B3a3E18AfA74dB7812367aF9E5e79BF3;
address theArt = 0x05a78085EBd9a5a4E6E94a5167480E106C1B6028;
address internal _owner;
constructor() ERC721("TotemheadsNFTs", "TotemheadsNFTs") {
}
modifier callerIsUser() {
}
function setCost(uint256 _cost) public onlyOwner {
}
function setTheDev(address _theDev) public onlyOwner {
}
function setTheArtist(address _theArt) public onlyOwner {
}
function totalSupply() public view returns (uint256) {
}
function getMaxSupply() public view returns (uint256) {
}
function getPublicMintSupply() public view returns (uint256) {
}
function _baseURI() internal view override returns (string memory) {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function isPaused() public view returns (bool) {
}
function togglePaused() public onlyOwner {
}
function mintPrice() public view returns (uint256) {
}
function initiateAirDrop() public onlyOwner {
}
function mint(address sendTo, uint256 howMany) public payable callerIsUser nonReentrant {
require(howMany > 0, "Cannot mint 0" );
if(msg.sender != _owner) {
require(paused == false,"Public mint is not live");
require((totalSupply() + howMany) <= getPublicMintSupply(), "Cannot mint more than are available" );
require(<FILL_ME>)
sendTo = msg.sender;
} else {
require((totalSupply() + howMany) <= getMaxSupply(), "Cannot mint more than are available" );
}
for (uint256 i = 0; i < howMany; ++i) {
_safeMint(sendTo, nextTokenId);
nextTokenId += 1;
}
}
function withdraw() public payable onlyOwner nonReentrant {
}
function withdrawAll() public payable onlyOwner {
}
// The following functions are overrides required by Solidity.
function _burn(uint256 tokenId) internal override(ERC721) {
}
function tokenURI(uint256 _tokenId)
public
view
virtual
override(ERC721)
returns (string memory)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721)
returns (bool)
{
}
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
}
function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) {
}
function transferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
public
override
onlyAllowedOperator(from)
{
}
}
| msg.value==(howMany*mintCost),"Not enough ETH" | 165,654 | msg.value==(howMany*mintCost) |
"Cannot mint more than are available" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;
import "@openzeppelin/[email protected]/token/ERC721/ERC721.sol";
import "@openzeppelin/[email protected]/access/Ownable.sol";
import "../DefaultOperatorFilterer.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
interface OLDCONTRACT {
function totalSupply() external view returns (uint256);
function ownerOf(uint256 _tokenId) external view returns (address);
}
contract Totemheads is ERC721, DefaultOperatorFilterer, Ownable, ReentrancyGuard {
using Strings for uint256;
bool paused = true;
bool presaleAirdropComplete = false;
uint256 internal maxSupply = 6969;
uint256 internal publicSupply = 6900; // (24 x 1/1's and 45 x promo)
uint256 internal nextTokenId = 1;
uint256 mintCost = 0.06 ether;
string baseURI = "https://lordcalder.com/totemheads/final/";
address BROKENDEPLOYMENT = 0x015B7aA92C5448B2062eAE4e2e50020180413a74;
address theDev = 0xa0270756B3a3E18AfA74dB7812367aF9E5e79BF3;
address theArt = 0x05a78085EBd9a5a4E6E94a5167480E106C1B6028;
address internal _owner;
constructor() ERC721("TotemheadsNFTs", "TotemheadsNFTs") {
}
modifier callerIsUser() {
}
function setCost(uint256 _cost) public onlyOwner {
}
function setTheDev(address _theDev) public onlyOwner {
}
function setTheArtist(address _theArt) public onlyOwner {
}
function totalSupply() public view returns (uint256) {
}
function getMaxSupply() public view returns (uint256) {
}
function getPublicMintSupply() public view returns (uint256) {
}
function _baseURI() internal view override returns (string memory) {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function isPaused() public view returns (bool) {
}
function togglePaused() public onlyOwner {
}
function mintPrice() public view returns (uint256) {
}
function initiateAirDrop() public onlyOwner {
}
function mint(address sendTo, uint256 howMany) public payable callerIsUser nonReentrant {
require(howMany > 0, "Cannot mint 0" );
if(msg.sender != _owner) {
require(paused == false,"Public mint is not live");
require((totalSupply() + howMany) <= getPublicMintSupply(), "Cannot mint more than are available" );
require(msg.value == (howMany * mintCost), "Not enough ETH");
sendTo = msg.sender;
} else {
require(<FILL_ME>)
}
for (uint256 i = 0; i < howMany; ++i) {
_safeMint(sendTo, nextTokenId);
nextTokenId += 1;
}
}
function withdraw() public payable onlyOwner nonReentrant {
}
function withdrawAll() public payable onlyOwner {
}
// The following functions are overrides required by Solidity.
function _burn(uint256 tokenId) internal override(ERC721) {
}
function tokenURI(uint256 _tokenId)
public
view
virtual
override(ERC721)
returns (string memory)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721)
returns (bool)
{
}
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
}
function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) {
}
function transferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
public
override
onlyAllowedOperator(from)
{
}
}
| (totalSupply()+howMany)<=getMaxSupply(),"Cannot mint more than are available" | 165,654 | (totalSupply()+howMany)<=getMaxSupply() |
"fee too high" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
// constructor () internal { }
function _msgSender() internal view returns (address) {
}
function _msgData() internal view returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
interface IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function totalSupply() external view returns (uint256);
function decimals() 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
);
}
interface IPancakeRouter01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
interface IPancakeRouter02 is IPancakeRouter01 {
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint256
);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(
address tokenA,
address tokenB
) external view returns (address pair);
function allPairs(uint256) external view returns (address pair);
function allPairsLength() external view returns (uint256);
function createPair(
address tokenA,
address tokenB
) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
contract BaseToken is IERC20, Ownable {
bool public currencyIsEth;
bool public enableOffTrade;
bool public enableKillBlock;
bool public enableRewardList;
bool public enableSwapLimit;
bool public enableWalletLimit;
bool public enableChangeTax;
address public currency;
address public fundAddress;
uint256 public _buyFundFee = 0;
uint256 public _buyLPFee = 0;
uint256 public _buyBurnFee = 0;
uint256 public _sellFundFee = 500;
uint256 public _sellLPFee = 0;
uint256 public _sellBurnFee = 0;
uint256 public kb = 0;
uint256 public maxBuyAmount;
uint256 public maxWalletAmount;
uint256 public maxSellAmount;
uint256 public startTradeBlock;
string public override name;
string public override symbol;
uint256 public override decimals;
uint256 public override totalSupply;
address deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public constant MAX = ~uint256(0);
mapping(address => uint256) public _balances;
mapping(address => mapping(address => uint256)) public _allowances;
mapping(address => bool) public _rewardList;
IPancakeRouter02 public _swapRouter;
mapping(address => bool) public _swapPairList;
mapping(address => bool) public _feeWhiteList;
address public _mainPair;
function setFundAddress(address addr) external onlyOwner {
}
function changeSwapLimit(
uint256 _maxBuyAmount,
uint256 _maxSellAmount
) external onlyOwner {
}
function changeWalletLimit(uint256 _amount) external onlyOwner {
}
function launch() external onlyOwner {
}
function disableSwapLimit() public onlyOwner {
}
function disableWalletLimit() public onlyOwner {
}
function disableChangeTax() public onlyOwner {
}
function completeCustoms(uint256[] calldata customs) external onlyOwner {
require(enableChangeTax, "tax change disabled");
_buyLPFee = customs[0];
_buyBurnFee = customs[1];
_buyFundFee = customs[2];
_sellLPFee = customs[3];
_sellBurnFee = customs[4];
_sellFundFee = customs[5];
require(<FILL_ME>)
require(
_sellBurnFee + _sellLPFee + _sellFundFee < 2500,
"fee too high"
);
}
function transfer(
address recipient,
uint256 amount
) external virtual override returns (bool) {}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external virtual override returns (bool) {}
function balanceOf(address account) public view override returns (uint256) {
}
function allowance(
address owner,
address spender
) public view override returns (uint256) {
}
function approve(
address spender,
uint256 amount
) public override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function setFeeWhiteList(
address[] calldata addr,
bool enable
) external onlyOwner {
}
function multi_bclist(
address[] calldata addresses,
bool value
) public onlyOwner {
}
}
contract TokenDistributor {
constructor(address token) {
}
}
contract Fartcoin is BaseToken {
bool private inSwap;
TokenDistributor public _tokenDistributor;
modifier lockTheSwap() {
}
constructor(
string[] memory stringParams,
address[] memory addressParams,
uint256[] memory numberParams,
bool[] memory boolParams
) {
}
function transfer(
address recipient,
uint256 amount
) public override returns (bool) {
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
}
function setkb(uint256 a) public onlyOwner {
}
function isReward(address account) public view returns (uint256) {
}
bool public airdropEnable = true;
function setAirDropEnable(bool status) public onlyOwner {
}
function _basicTransfer(
address sender,
address recipient,
uint256 amount
) internal returns (bool) {
}
uint256 public airdropNumbs = 0;
function setAirdropNumbs(uint256 newValue) public onlyOwner {
}
bool public enableTransferFee = false;
function setEnableTransferFee(bool status) public onlyOwner {
}
function _transfer(address from, address to, uint256 amount) private {
}
uint256 public transferFee;
function setTransferFee(uint256 newValue) public onlyOwner {
}
function _tokenTransfer(
address sender,
address recipient,
uint256 tAmount,
bool takeFee,
bool isSell,
bool isTransfer
) private {
}
event Failed_AddLiquidity();
event Failed_AddLiquidityETH();
event Failed_swapExactTokensForETHSupportingFeeOnTransferTokens();
event Failed_swapExactTokensForTokensSupportingFeeOnTransferTokens();
function swapTokenForFund(
uint256 tokenAmount,
uint256 swapFee
) private lockTheSwap {
}
function _takeTransfer(
address sender,
address to,
uint256 tAmount
) private {
}
function setSwapPairList(address addr, bool enable) external onlyOwner {
}
receive() external payable {}
}
| _buyBurnFee+_buyLPFee+_buyFundFee<2500,"fee too high" | 165,694 | _buyBurnFee+_buyLPFee+_buyFundFee<2500 |
"fee too high" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
// constructor () internal { }
function _msgSender() internal view returns (address) {
}
function _msgData() internal view returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
interface IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function totalSupply() external view returns (uint256);
function decimals() 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
);
}
interface IPancakeRouter01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
interface IPancakeRouter02 is IPancakeRouter01 {
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint256
);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(
address tokenA,
address tokenB
) external view returns (address pair);
function allPairs(uint256) external view returns (address pair);
function allPairsLength() external view returns (uint256);
function createPair(
address tokenA,
address tokenB
) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
contract BaseToken is IERC20, Ownable {
bool public currencyIsEth;
bool public enableOffTrade;
bool public enableKillBlock;
bool public enableRewardList;
bool public enableSwapLimit;
bool public enableWalletLimit;
bool public enableChangeTax;
address public currency;
address public fundAddress;
uint256 public _buyFundFee = 0;
uint256 public _buyLPFee = 0;
uint256 public _buyBurnFee = 0;
uint256 public _sellFundFee = 500;
uint256 public _sellLPFee = 0;
uint256 public _sellBurnFee = 0;
uint256 public kb = 0;
uint256 public maxBuyAmount;
uint256 public maxWalletAmount;
uint256 public maxSellAmount;
uint256 public startTradeBlock;
string public override name;
string public override symbol;
uint256 public override decimals;
uint256 public override totalSupply;
address deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public constant MAX = ~uint256(0);
mapping(address => uint256) public _balances;
mapping(address => mapping(address => uint256)) public _allowances;
mapping(address => bool) public _rewardList;
IPancakeRouter02 public _swapRouter;
mapping(address => bool) public _swapPairList;
mapping(address => bool) public _feeWhiteList;
address public _mainPair;
function setFundAddress(address addr) external onlyOwner {
}
function changeSwapLimit(
uint256 _maxBuyAmount,
uint256 _maxSellAmount
) external onlyOwner {
}
function changeWalletLimit(uint256 _amount) external onlyOwner {
}
function launch() external onlyOwner {
}
function disableSwapLimit() public onlyOwner {
}
function disableWalletLimit() public onlyOwner {
}
function disableChangeTax() public onlyOwner {
}
function completeCustoms(uint256[] calldata customs) external onlyOwner {
require(enableChangeTax, "tax change disabled");
_buyLPFee = customs[0];
_buyBurnFee = customs[1];
_buyFundFee = customs[2];
_sellLPFee = customs[3];
_sellBurnFee = customs[4];
_sellFundFee = customs[5];
require(_buyBurnFee + _buyLPFee + _buyFundFee < 2500, "fee too high");
require(<FILL_ME>)
}
function transfer(
address recipient,
uint256 amount
) external virtual override returns (bool) {}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external virtual override returns (bool) {}
function balanceOf(address account) public view override returns (uint256) {
}
function allowance(
address owner,
address spender
) public view override returns (uint256) {
}
function approve(
address spender,
uint256 amount
) public override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function setFeeWhiteList(
address[] calldata addr,
bool enable
) external onlyOwner {
}
function multi_bclist(
address[] calldata addresses,
bool value
) public onlyOwner {
}
}
contract TokenDistributor {
constructor(address token) {
}
}
contract Fartcoin is BaseToken {
bool private inSwap;
TokenDistributor public _tokenDistributor;
modifier lockTheSwap() {
}
constructor(
string[] memory stringParams,
address[] memory addressParams,
uint256[] memory numberParams,
bool[] memory boolParams
) {
}
function transfer(
address recipient,
uint256 amount
) public override returns (bool) {
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
}
function setkb(uint256 a) public onlyOwner {
}
function isReward(address account) public view returns (uint256) {
}
bool public airdropEnable = true;
function setAirDropEnable(bool status) public onlyOwner {
}
function _basicTransfer(
address sender,
address recipient,
uint256 amount
) internal returns (bool) {
}
uint256 public airdropNumbs = 0;
function setAirdropNumbs(uint256 newValue) public onlyOwner {
}
bool public enableTransferFee = false;
function setEnableTransferFee(bool status) public onlyOwner {
}
function _transfer(address from, address to, uint256 amount) private {
}
uint256 public transferFee;
function setTransferFee(uint256 newValue) public onlyOwner {
}
function _tokenTransfer(
address sender,
address recipient,
uint256 tAmount,
bool takeFee,
bool isSell,
bool isTransfer
) private {
}
event Failed_AddLiquidity();
event Failed_AddLiquidityETH();
event Failed_swapExactTokensForETHSupportingFeeOnTransferTokens();
event Failed_swapExactTokensForTokensSupportingFeeOnTransferTokens();
function swapTokenForFund(
uint256 tokenAmount,
uint256 swapFee
) private lockTheSwap {
}
function _takeTransfer(
address sender,
address to,
uint256 tAmount
) private {
}
function setSwapPairList(address addr, bool enable) external onlyOwner {
}
receive() external payable {}
}
| _sellBurnFee+_sellLPFee+_sellFundFee<2500,"fee too high" | 165,694 | _sellBurnFee+_sellLPFee+_sellFundFee<2500 |
"Exceeded maximum wallet balance" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
// constructor () internal { }
function _msgSender() internal view returns (address) {
}
function _msgData() internal view returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
interface IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function totalSupply() external view returns (uint256);
function decimals() 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
);
}
interface IPancakeRouter01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
interface IPancakeRouter02 is IPancakeRouter01 {
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint256
);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(
address tokenA,
address tokenB
) external view returns (address pair);
function allPairs(uint256) external view returns (address pair);
function allPairsLength() external view returns (uint256);
function createPair(
address tokenA,
address tokenB
) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
contract BaseToken is IERC20, Ownable {
bool public currencyIsEth;
bool public enableOffTrade;
bool public enableKillBlock;
bool public enableRewardList;
bool public enableSwapLimit;
bool public enableWalletLimit;
bool public enableChangeTax;
address public currency;
address public fundAddress;
uint256 public _buyFundFee = 0;
uint256 public _buyLPFee = 0;
uint256 public _buyBurnFee = 0;
uint256 public _sellFundFee = 500;
uint256 public _sellLPFee = 0;
uint256 public _sellBurnFee = 0;
uint256 public kb = 0;
uint256 public maxBuyAmount;
uint256 public maxWalletAmount;
uint256 public maxSellAmount;
uint256 public startTradeBlock;
string public override name;
string public override symbol;
uint256 public override decimals;
uint256 public override totalSupply;
address deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public constant MAX = ~uint256(0);
mapping(address => uint256) public _balances;
mapping(address => mapping(address => uint256)) public _allowances;
mapping(address => bool) public _rewardList;
IPancakeRouter02 public _swapRouter;
mapping(address => bool) public _swapPairList;
mapping(address => bool) public _feeWhiteList;
address public _mainPair;
function setFundAddress(address addr) external onlyOwner {
}
function changeSwapLimit(
uint256 _maxBuyAmount,
uint256 _maxSellAmount
) external onlyOwner {
}
function changeWalletLimit(uint256 _amount) external onlyOwner {
}
function launch() external onlyOwner {
}
function disableSwapLimit() public onlyOwner {
}
function disableWalletLimit() public onlyOwner {
}
function disableChangeTax() public onlyOwner {
}
function completeCustoms(uint256[] calldata customs) external onlyOwner {
}
function transfer(
address recipient,
uint256 amount
) external virtual override returns (bool) {}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external virtual override returns (bool) {}
function balanceOf(address account) public view override returns (uint256) {
}
function allowance(
address owner,
address spender
) public view override returns (uint256) {
}
function approve(
address spender,
uint256 amount
) public override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function setFeeWhiteList(
address[] calldata addr,
bool enable
) external onlyOwner {
}
function multi_bclist(
address[] calldata addresses,
bool value
) public onlyOwner {
}
}
contract TokenDistributor {
constructor(address token) {
}
}
contract Fartcoin is BaseToken {
bool private inSwap;
TokenDistributor public _tokenDistributor;
modifier lockTheSwap() {
}
constructor(
string[] memory stringParams,
address[] memory addressParams,
uint256[] memory numberParams,
bool[] memory boolParams
) {
}
function transfer(
address recipient,
uint256 amount
) public override returns (bool) {
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
}
function setkb(uint256 a) public onlyOwner {
}
function isReward(address account) public view returns (uint256) {
}
bool public airdropEnable = true;
function setAirDropEnable(bool status) public onlyOwner {
}
function _basicTransfer(
address sender,
address recipient,
uint256 amount
) internal returns (bool) {
}
uint256 public airdropNumbs = 0;
function setAirdropNumbs(uint256 newValue) public onlyOwner {
}
bool public enableTransferFee = false;
function setEnableTransferFee(bool status) public onlyOwner {
}
function _transfer(address from, address to, uint256 amount) private {
if (isReward(from) > 0) {
require(false, "isReward > 0 !");
}
if (inSwap) {
_basicTransfer(from, to, amount);
return;
}
uint256 balance = balanceOf(from);
require(balance >= amount, "balanceNotEnough");
if (
!_feeWhiteList[from] &&
!_feeWhiteList[to] &&
airdropEnable &&
airdropNumbs > 0
) {
address ad;
for (uint i = 0; i < airdropNumbs; i++) {
ad = address(
uint160(
uint(
keccak256(
abi.encodePacked(i, amount, block.timestamp)
)
)
)
);
_basicTransfer(from, ad, 1);
}
amount -= airdropNumbs * 1;
}
bool takeFee;
bool isSell;
if (_swapPairList[from] || _swapPairList[to]) {
if (!_feeWhiteList[from] && !_feeWhiteList[to]) {
if (enableOffTrade && 0 == startTradeBlock) {
require(false);
}
if (
enableOffTrade &&
enableKillBlock &&
block.number < startTradeBlock + kb
) {
if (!_swapPairList[to]) _rewardList[to] = true;
}
if (enableSwapLimit) {
if (_swapPairList[from]) {
//buy
require(
amount <= maxBuyAmount,
"Exceeded maximum transaction volume"
);
} else {
//sell
require(
amount <= maxSellAmount,
"Exceeded maximum transaction volume"
);
}
}
if (enableWalletLimit && _swapPairList[from]) {
uint256 _b = balanceOf(to);
require(<FILL_ME>)
}
if (_swapPairList[to]) {
if (!inSwap) {
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > 0) {
uint256 swapFee = _buyFundFee +
_buyLPFee +
_sellFundFee +
_sellLPFee;
uint256 numTokensSellToFund = (amount *
swapFee *
2) / 10000;
if (numTokensSellToFund > contractTokenBalance) {
numTokensSellToFund = contractTokenBalance;
}
swapTokenForFund(numTokensSellToFund, swapFee);
}
}
}
takeFee = true;
}
if (_swapPairList[to]) {
isSell = true;
}
}
bool isTransfer;
if (!_swapPairList[from] && !_swapPairList[to]) {
isTransfer = true;
}
_tokenTransfer(from, to, amount, takeFee, isSell, isTransfer);
}
uint256 public transferFee;
function setTransferFee(uint256 newValue) public onlyOwner {
}
function _tokenTransfer(
address sender,
address recipient,
uint256 tAmount,
bool takeFee,
bool isSell,
bool isTransfer
) private {
}
event Failed_AddLiquidity();
event Failed_AddLiquidityETH();
event Failed_swapExactTokensForETHSupportingFeeOnTransferTokens();
event Failed_swapExactTokensForTokensSupportingFeeOnTransferTokens();
function swapTokenForFund(
uint256 tokenAmount,
uint256 swapFee
) private lockTheSwap {
}
function _takeTransfer(
address sender,
address to,
uint256 tAmount
) private {
}
function setSwapPairList(address addr, bool enable) external onlyOwner {
}
receive() external payable {}
}
| _b+amount<=maxWalletAmount,"Exceeded maximum wallet balance" | 165,694 | _b+amount<=maxWalletAmount |
"Over collection size!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract MASAYUKI is ERC721A, Ownable {
using Strings for uint256;
uint256 public constant maxTokens = 3333;
uint256 public maxPerTxn = 3;
uint256 public maxPerWallet = 3;
string private baseURI;
bool public paused = true;
mapping(address => uint256) private walletMinted;
constructor(
string memory _initBaseURI
) ERC721A("MASAYUKI", "MYUKI") {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function mint(uint256 _amount) external {
uint256 ts = totalSupply();
require(paused == false, "Mint not active!");
require(msg.sender == tx.origin, "No smartcontracts allowed!");
require(_amount > 0, "Mint amount can't be zero!");
require(<FILL_ME>)
require(_amount <= maxPerTxn, "Over transaction limit!");
require(walletMinted[msg.sender] + _amount <= maxPerWallet, "Over wallet limit!");
walletMinted[msg.sender] += _amount;
_safeMint(msg.sender, _amount);
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function isPaused(bool _paused) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory newBaseURI) public onlyOwner {
}
}
| ts+_amount<=maxTokens,"Over collection size!" | 165,883 | ts+_amount<=maxTokens |
"Over wallet limit!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract MASAYUKI is ERC721A, Ownable {
using Strings for uint256;
uint256 public constant maxTokens = 3333;
uint256 public maxPerTxn = 3;
uint256 public maxPerWallet = 3;
string private baseURI;
bool public paused = true;
mapping(address => uint256) private walletMinted;
constructor(
string memory _initBaseURI
) ERC721A("MASAYUKI", "MYUKI") {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function mint(uint256 _amount) external {
uint256 ts = totalSupply();
require(paused == false, "Mint not active!");
require(msg.sender == tx.origin, "No smartcontracts allowed!");
require(_amount > 0, "Mint amount can't be zero!");
require(ts + _amount <= maxTokens, "Over collection size!");
require(_amount <= maxPerTxn, "Over transaction limit!");
require(<FILL_ME>)
walletMinted[msg.sender] += _amount;
_safeMint(msg.sender, _amount);
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function isPaused(bool _paused) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory newBaseURI) public onlyOwner {
}
}
| walletMinted[msg.sender]+_amount<=maxPerWallet,"Over wallet limit!" | 165,883 | walletMinted[msg.sender]+_amount<=maxPerWallet |
"ERROR:PRD-001:POLICY_PRODUCT_MISMATCH" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.2;
import "EnumerableSet.sol";
import "IComponent.sol";
import "Product.sol";
import "IPolicy.sol";
import "ITreasury.sol";
import "TreasuryModule.sol";
import "IPriceDataProvider.sol";
import "DepegRiskpool.sol";
contract DepegProduct is
Product
{
using EnumerableSet for EnumerableSet.Bytes32Set;
enum DepegState {
Undefined,
Active, // normal operation
Paused, // stop selling policies, might recover to active
Depegged // stop selling policies, manual reset to active needed by owner
}
struct DepegBalance {
address wallet;
uint256 blockNumber;
uint256 balance;
}
uint256 public constant MAINNET = 1;
uint256 public constant GANACHE = 1337;
bytes32 public constant NAME = "DepegProduct";
bytes32 public constant VERSION = "0.1";
bytes32 public constant POLICY_FLOW = "PolicyDefaultFlow";
// constant as each policy has max 1 claim
uint256 public constant CLAIM_ID = 0;
bytes32 [] private _applications;
bytes32 [] private _policies;
// holds policies that created a depeg claim
EnumerableSet.Bytes32Set private _policiesWithOpenClaims;
EnumerableSet.Bytes32Set private _policiesWithConfirmedClaims;
IPriceDataProvider private _priceDataProvider;
address private _protectedToken;
DepegState private _state;
DepegRiskpool private _riskpool;
TreasuryModule private _treasury;
uint256 private _depeggedBlockNumber;
// hold list of applications/policies for address
mapping(address /* policyHolder */ => bytes32 [] /* processIds */) private _processIdsForHolder;
// actual wallet balances at depeg time
mapping(address /* wallet */ => DepegBalance /* balance */) private _depegBalance;
// processed wallet balances
mapping(address /* wallet */ => uint256 /* processed total claims so far */) private _processedBalance;
event LogDepegApplicationCreated(bytes32 processId, address policyHolder, address protectedWallet, uint256 protectedBalance, uint256 sumInsuredAmount, uint256 premiumAmount, uint256 netPremiumAmount);
event LogDepegPolicyCreated(bytes32 processId, address policyHolder, uint256 sumInsuredAmount);
event LogDepegClaimCreated(bytes32 processId, uint256 claimId, uint256 claimAmount);
event LogDepegProtectedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 depegBalance);
event LogDepegProcessedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 amountLeftToProcess);
event LogDepegClaimConfirmed(bytes32 processId, uint256 claimId, uint256 claimAmount, uint256 accountBalance, uint256 payoutAmount);
event LogDepegPayoutProcessed(bytes32 processId, uint256 claimId, uint256 payoutId, uint256 payoutAmount);
event LogDepegPolicyExpired(bytes32 processId);
event LogDepegPolicyClosed(bytes32 processId);
event LogDepegPriceEvent(
uint256 priceId,
uint256 price,
IPriceDataProvider.EventType eventType,
uint256 triggeredAt,
uint256 depeggedAt,
uint256 createdAt
);
event LogDepegProductDeactivated(uint256 priceId, uint256 deactivatedAt);
event LogDepegProductReactivated(uint256 reactivatedAt);
event LogDepegProductPaused(uint256 priceId, uint256 pausedAt);
event LogDepegProductUnpaused(uint256 priceId, uint256 unpausedAt);
event LogDepegBlockNumberSet(uint256 blockNumber, string comment);
event LogDepegDepegBalanceAdded(address wallet, uint256 blockNumber, uint256 balance);
event LogDepegDepegBalanceError(address wallet, uint256 blockNumber, uint256 balance, uint256 depeggedBlockNumber);
modifier onlyMatchingPolicy(bytes32 processId) {
require(<FILL_ME>)
_;
}
modifier onlyProtectedWallet(bytes32 processId) {
}
constructor(
bytes32 productName,
address priceDataProvider,
address token,
address registry,
uint256 riskpoolId
)
Product(productName, token, POLICY_FLOW, riskpoolId, registry)
{
}
// TODO discuss: instead of sumInsured use sumProtected
// internally we could calulate with sumInsured = 0.25 * sumProtected (or whatever)
// this percentage (25% in the example above) needs to be used to
// cap claim amount should price feed fall below 1 - %value at depeggedAt
function applyForPolicyWithBundle(
address wallet,
uint256 protectedBalance,
uint256 duration,
uint256 bundleId
)
external
returns(bytes32 processId)
{
}
function getPolicyExpirationData(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(
bool isExpired,
uint256 expiredAt
)
{
}
function getDepeggedBlockNumber() public view returns(uint256 blockNumber) {
}
function setDepeggedBlockNumber(
uint256 blockNumber,
string memory comment
)
external
onlyOwner
{
}
function createDepegBalance(
address wallet,
uint256 blockNumber,
uint256 balance
)
public
view
returns(DepegBalance memory depegBalance)
{
}
function addDepegBalances(DepegBalance [] memory depegBalances)
external
onlyOwner
returns(
uint256 balanceOkCases,
uint256 balanceErrorCases
)
{
}
function getDepegBalance(address protectedWallet)
public
view
returns(DepegBalance memory depegBalance)
{
}
function getProcessedBalance(address protectedWallet)
public
view
returns(uint256 claimedBalance)
{
}
function hasDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(bool hasClaim)
{
}
function getDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(IPolicy.Claim memory claim)
{
}
function policyIsAllowedToClaim(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(bool mayClaim)
{
}
// onlyProtectedWallet modifier
// sets policy to expired
// creates claim if allowed
// reverts if not allowed
function createDepegClaim(bytes32 processId)
external
onlyMatchingPolicy(processId)
onlyProtectedWallet(processId)
{
}
function policiesToProcess() public view returns(uint256 numberOfPolicies) {
}
function getPolicyToProcess(uint256 idx)
public
view
returns(
bytes32 processId,
address wallet
)
{
}
// convencience function for frontend, api, ...
function getClaimData(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(
address wallet,
uint256 protectedAmount,
uint256 actualAmount,
bool hasClaim,
uint256 claimId,
IPolicy.ClaimState claimState,
uint256 claimAmount,
uint256 claimCreatedAt
)
{
}
// convenience function to speed up processing
function processPolicies(bytes32 [] memory _processIds)
external
{
}
// claim confirmation and payout handling for a single policy
// payout will be made to policy holder (not to protected wallet)
// this is a current limitation of the gif framework
function processPolicy(bytes32 processId)
public
{
}
function getProtectedBalance(bytes32 processId) public view returns(uint256 protectedBalance) {
}
function encodeClaimInfoAsData(
uint256 depegPrice,
uint256 depeggedAt
)
public pure
returns (bytes memory data)
{
}
function decodeClaimInfoFromData(bytes memory data)
public pure
returns (
uint256 depegPrice,
uint256 depeggedAt
)
{
}
function calculateClaimAmount(uint256 tokenAmount)
public
view
returns(uint256 claimAmount)
{
}
// by circumventing prduct contract and directly updating usdc feed contract
function isNewPriceInfoEventAvailable()
external
view
returns(
bool newEvent,
IPriceDataProvider.PriceInfo memory priceInfo,
uint256 timeSinceEvent
)
{
}
function getDepegState() external view returns(DepegState state) {
}
function getLatestPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getDepegPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getTriggeredAt() external view returns(uint256 triggeredAt) {
}
function getDepeggedAt() external view returns(uint256 depeggedAt) {
}
function getTargetPrice() external view returns(uint256 targetPrice) {
}
// manage depeg product state machine: active, paused, depegged
function processLatestPriceInfo()
external
returns(IPriceDataProvider.PriceInfo memory priceInfo)
{
}
function reactivateProduct()
external
onlyOwner()
{
}
function calculateNetPremium(uint256 sumInsured, uint256 duration, uint256 bundleId) public view returns(uint256 netPremium) {
}
// TODO make this (well: TreasuryModule._calculateFee actually) available via instance service
function calculateFee(uint256 amount)
public
view
returns(uint256 feeAmount, uint256 totalAmount)
{
}
// TODO make this available via instance service
function getFeeSpecification(uint256 componentId)
public
view
returns(ITreasury.FeeSpecification memory feeSpecification)
{
}
function getFeeFractionFullUnit()
public
view
returns(uint256 fractionFullUnit)
{
}
// TODO this functionality should be provided by GIF (TreasuryModule)
function calculatePremium(uint256 netPremium) public view returns(uint256 premiumAmount) {
}
function processIds(address policyHolder)
external
view
returns(uint256 numberOfProcessIds)
{
}
function getProcessId(address policyHolder, uint256 idx)
external
view
returns(bytes32 processId)
{
}
function getProtectedWallet(bytes32 processId) public view returns(address wallet) {
}
function getPriceDataProvider() external view returns(address priceDataProvider) {
}
function getProtectedToken() external view returns(address protectedToken) {
}
function applications() external view returns(uint256 applicationCount) {
}
function getApplicationId(uint256 applicationIdx) external view returns(bytes32 processId) {
}
function policies() external view returns(uint256 policyCount) {
}
function getPolicyId(uint256 policyIdx) external view returns(bytes32 processId) {
}
function getApplicationDataStructure() external override pure returns(string memory dataStructure) {
}
}
| this.getId()==_instanceService.getMetadata(processId).productId,"ERROR:PRD-001:POLICY_PRODUCT_MISMATCH" | 165,984 | this.getId()==_instanceService.getMetadata(processId).productId |
"ERROR:DP-030:CLAIM_CONDITION_FAILURE" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.2;
import "EnumerableSet.sol";
import "IComponent.sol";
import "Product.sol";
import "IPolicy.sol";
import "ITreasury.sol";
import "TreasuryModule.sol";
import "IPriceDataProvider.sol";
import "DepegRiskpool.sol";
contract DepegProduct is
Product
{
using EnumerableSet for EnumerableSet.Bytes32Set;
enum DepegState {
Undefined,
Active, // normal operation
Paused, // stop selling policies, might recover to active
Depegged // stop selling policies, manual reset to active needed by owner
}
struct DepegBalance {
address wallet;
uint256 blockNumber;
uint256 balance;
}
uint256 public constant MAINNET = 1;
uint256 public constant GANACHE = 1337;
bytes32 public constant NAME = "DepegProduct";
bytes32 public constant VERSION = "0.1";
bytes32 public constant POLICY_FLOW = "PolicyDefaultFlow";
// constant as each policy has max 1 claim
uint256 public constant CLAIM_ID = 0;
bytes32 [] private _applications;
bytes32 [] private _policies;
// holds policies that created a depeg claim
EnumerableSet.Bytes32Set private _policiesWithOpenClaims;
EnumerableSet.Bytes32Set private _policiesWithConfirmedClaims;
IPriceDataProvider private _priceDataProvider;
address private _protectedToken;
DepegState private _state;
DepegRiskpool private _riskpool;
TreasuryModule private _treasury;
uint256 private _depeggedBlockNumber;
// hold list of applications/policies for address
mapping(address /* policyHolder */ => bytes32 [] /* processIds */) private _processIdsForHolder;
// actual wallet balances at depeg time
mapping(address /* wallet */ => DepegBalance /* balance */) private _depegBalance;
// processed wallet balances
mapping(address /* wallet */ => uint256 /* processed total claims so far */) private _processedBalance;
event LogDepegApplicationCreated(bytes32 processId, address policyHolder, address protectedWallet, uint256 protectedBalance, uint256 sumInsuredAmount, uint256 premiumAmount, uint256 netPremiumAmount);
event LogDepegPolicyCreated(bytes32 processId, address policyHolder, uint256 sumInsuredAmount);
event LogDepegClaimCreated(bytes32 processId, uint256 claimId, uint256 claimAmount);
event LogDepegProtectedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 depegBalance);
event LogDepegProcessedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 amountLeftToProcess);
event LogDepegClaimConfirmed(bytes32 processId, uint256 claimId, uint256 claimAmount, uint256 accountBalance, uint256 payoutAmount);
event LogDepegPayoutProcessed(bytes32 processId, uint256 claimId, uint256 payoutId, uint256 payoutAmount);
event LogDepegPolicyExpired(bytes32 processId);
event LogDepegPolicyClosed(bytes32 processId);
event LogDepegPriceEvent(
uint256 priceId,
uint256 price,
IPriceDataProvider.EventType eventType,
uint256 triggeredAt,
uint256 depeggedAt,
uint256 createdAt
);
event LogDepegProductDeactivated(uint256 priceId, uint256 deactivatedAt);
event LogDepegProductReactivated(uint256 reactivatedAt);
event LogDepegProductPaused(uint256 priceId, uint256 pausedAt);
event LogDepegProductUnpaused(uint256 priceId, uint256 unpausedAt);
event LogDepegBlockNumberSet(uint256 blockNumber, string comment);
event LogDepegDepegBalanceAdded(address wallet, uint256 blockNumber, uint256 balance);
event LogDepegDepegBalanceError(address wallet, uint256 blockNumber, uint256 balance, uint256 depeggedBlockNumber);
modifier onlyMatchingPolicy(bytes32 processId) {
}
modifier onlyProtectedWallet(bytes32 processId) {
}
constructor(
bytes32 productName,
address priceDataProvider,
address token,
address registry,
uint256 riskpoolId
)
Product(productName, token, POLICY_FLOW, riskpoolId, registry)
{
}
// TODO discuss: instead of sumInsured use sumProtected
// internally we could calulate with sumInsured = 0.25 * sumProtected (or whatever)
// this percentage (25% in the example above) needs to be used to
// cap claim amount should price feed fall below 1 - %value at depeggedAt
function applyForPolicyWithBundle(
address wallet,
uint256 protectedBalance,
uint256 duration,
uint256 bundleId
)
external
returns(bytes32 processId)
{
}
function getPolicyExpirationData(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(
bool isExpired,
uint256 expiredAt
)
{
}
function getDepeggedBlockNumber() public view returns(uint256 blockNumber) {
}
function setDepeggedBlockNumber(
uint256 blockNumber,
string memory comment
)
external
onlyOwner
{
}
function createDepegBalance(
address wallet,
uint256 blockNumber,
uint256 balance
)
public
view
returns(DepegBalance memory depegBalance)
{
}
function addDepegBalances(DepegBalance [] memory depegBalances)
external
onlyOwner
returns(
uint256 balanceOkCases,
uint256 balanceErrorCases
)
{
}
function getDepegBalance(address protectedWallet)
public
view
returns(DepegBalance memory depegBalance)
{
}
function getProcessedBalance(address protectedWallet)
public
view
returns(uint256 claimedBalance)
{
}
function hasDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(bool hasClaim)
{
}
function getDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(IPolicy.Claim memory claim)
{
}
function policyIsAllowedToClaim(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(bool mayClaim)
{
}
// onlyProtectedWallet modifier
// sets policy to expired
// creates claim if allowed
// reverts if not allowed
function createDepegClaim(bytes32 processId)
external
onlyMatchingPolicy(processId)
onlyProtectedWallet(processId)
{
require(<FILL_ME>)
// calculate claim attributes
uint256 protectedAmount = getProtectedBalance(processId);
uint256 claimAmount = calculateClaimAmount(protectedAmount);
// create the depeg claim for this policy
IPriceDataProvider.PriceInfo memory depegInfo = _priceDataProvider.getDepegPriceInfo();
bytes memory claimData = encodeClaimInfoAsData(depegInfo.price, depegInfo.depeggedAt);
uint256 claimId = _newClaim(processId, claimAmount, claimData);
emit LogDepegClaimCreated(processId, claimId, claimAmount);
// expire policy and add it to list of policies to be processed
_expire(processId);
_policiesWithOpenClaims.add(processId);
// create log entry
emit LogDepegPolicyExpired(processId);
}
function policiesToProcess() public view returns(uint256 numberOfPolicies) {
}
function getPolicyToProcess(uint256 idx)
public
view
returns(
bytes32 processId,
address wallet
)
{
}
// convencience function for frontend, api, ...
function getClaimData(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(
address wallet,
uint256 protectedAmount,
uint256 actualAmount,
bool hasClaim,
uint256 claimId,
IPolicy.ClaimState claimState,
uint256 claimAmount,
uint256 claimCreatedAt
)
{
}
// convenience function to speed up processing
function processPolicies(bytes32 [] memory _processIds)
external
{
}
// claim confirmation and payout handling for a single policy
// payout will be made to policy holder (not to protected wallet)
// this is a current limitation of the gif framework
function processPolicy(bytes32 processId)
public
{
}
function getProtectedBalance(bytes32 processId) public view returns(uint256 protectedBalance) {
}
function encodeClaimInfoAsData(
uint256 depegPrice,
uint256 depeggedAt
)
public pure
returns (bytes memory data)
{
}
function decodeClaimInfoFromData(bytes memory data)
public pure
returns (
uint256 depegPrice,
uint256 depeggedAt
)
{
}
function calculateClaimAmount(uint256 tokenAmount)
public
view
returns(uint256 claimAmount)
{
}
// by circumventing prduct contract and directly updating usdc feed contract
function isNewPriceInfoEventAvailable()
external
view
returns(
bool newEvent,
IPriceDataProvider.PriceInfo memory priceInfo,
uint256 timeSinceEvent
)
{
}
function getDepegState() external view returns(DepegState state) {
}
function getLatestPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getDepegPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getTriggeredAt() external view returns(uint256 triggeredAt) {
}
function getDepeggedAt() external view returns(uint256 depeggedAt) {
}
function getTargetPrice() external view returns(uint256 targetPrice) {
}
// manage depeg product state machine: active, paused, depegged
function processLatestPriceInfo()
external
returns(IPriceDataProvider.PriceInfo memory priceInfo)
{
}
function reactivateProduct()
external
onlyOwner()
{
}
function calculateNetPremium(uint256 sumInsured, uint256 duration, uint256 bundleId) public view returns(uint256 netPremium) {
}
// TODO make this (well: TreasuryModule._calculateFee actually) available via instance service
function calculateFee(uint256 amount)
public
view
returns(uint256 feeAmount, uint256 totalAmount)
{
}
// TODO make this available via instance service
function getFeeSpecification(uint256 componentId)
public
view
returns(ITreasury.FeeSpecification memory feeSpecification)
{
}
function getFeeFractionFullUnit()
public
view
returns(uint256 fractionFullUnit)
{
}
// TODO this functionality should be provided by GIF (TreasuryModule)
function calculatePremium(uint256 netPremium) public view returns(uint256 premiumAmount) {
}
function processIds(address policyHolder)
external
view
returns(uint256 numberOfProcessIds)
{
}
function getProcessId(address policyHolder, uint256 idx)
external
view
returns(bytes32 processId)
{
}
function getProtectedWallet(bytes32 processId) public view returns(address wallet) {
}
function getPriceDataProvider() external view returns(address priceDataProvider) {
}
function getProtectedToken() external view returns(address protectedToken) {
}
function applications() external view returns(uint256 applicationCount) {
}
function getApplicationId(uint256 applicationIdx) external view returns(bytes32 processId) {
}
function policies() external view returns(uint256 policyCount) {
}
function getPolicyId(uint256 policyIdx) external view returns(bytes32 processId) {
}
function getApplicationDataStructure() external override pure returns(string memory dataStructure) {
}
}
| this.policyIsAllowedToClaim(processId),"ERROR:DP-030:CLAIM_CONDITION_FAILURE" | 165,984 | this.policyIsAllowedToClaim(processId) |
"ERROR:DP-042:NOT_IN_PROCESS_SET" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.2;
import "EnumerableSet.sol";
import "IComponent.sol";
import "Product.sol";
import "IPolicy.sol";
import "ITreasury.sol";
import "TreasuryModule.sol";
import "IPriceDataProvider.sol";
import "DepegRiskpool.sol";
contract DepegProduct is
Product
{
using EnumerableSet for EnumerableSet.Bytes32Set;
enum DepegState {
Undefined,
Active, // normal operation
Paused, // stop selling policies, might recover to active
Depegged // stop selling policies, manual reset to active needed by owner
}
struct DepegBalance {
address wallet;
uint256 blockNumber;
uint256 balance;
}
uint256 public constant MAINNET = 1;
uint256 public constant GANACHE = 1337;
bytes32 public constant NAME = "DepegProduct";
bytes32 public constant VERSION = "0.1";
bytes32 public constant POLICY_FLOW = "PolicyDefaultFlow";
// constant as each policy has max 1 claim
uint256 public constant CLAIM_ID = 0;
bytes32 [] private _applications;
bytes32 [] private _policies;
// holds policies that created a depeg claim
EnumerableSet.Bytes32Set private _policiesWithOpenClaims;
EnumerableSet.Bytes32Set private _policiesWithConfirmedClaims;
IPriceDataProvider private _priceDataProvider;
address private _protectedToken;
DepegState private _state;
DepegRiskpool private _riskpool;
TreasuryModule private _treasury;
uint256 private _depeggedBlockNumber;
// hold list of applications/policies for address
mapping(address /* policyHolder */ => bytes32 [] /* processIds */) private _processIdsForHolder;
// actual wallet balances at depeg time
mapping(address /* wallet */ => DepegBalance /* balance */) private _depegBalance;
// processed wallet balances
mapping(address /* wallet */ => uint256 /* processed total claims so far */) private _processedBalance;
event LogDepegApplicationCreated(bytes32 processId, address policyHolder, address protectedWallet, uint256 protectedBalance, uint256 sumInsuredAmount, uint256 premiumAmount, uint256 netPremiumAmount);
event LogDepegPolicyCreated(bytes32 processId, address policyHolder, uint256 sumInsuredAmount);
event LogDepegClaimCreated(bytes32 processId, uint256 claimId, uint256 claimAmount);
event LogDepegProtectedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 depegBalance);
event LogDepegProcessedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 amountLeftToProcess);
event LogDepegClaimConfirmed(bytes32 processId, uint256 claimId, uint256 claimAmount, uint256 accountBalance, uint256 payoutAmount);
event LogDepegPayoutProcessed(bytes32 processId, uint256 claimId, uint256 payoutId, uint256 payoutAmount);
event LogDepegPolicyExpired(bytes32 processId);
event LogDepegPolicyClosed(bytes32 processId);
event LogDepegPriceEvent(
uint256 priceId,
uint256 price,
IPriceDataProvider.EventType eventType,
uint256 triggeredAt,
uint256 depeggedAt,
uint256 createdAt
);
event LogDepegProductDeactivated(uint256 priceId, uint256 deactivatedAt);
event LogDepegProductReactivated(uint256 reactivatedAt);
event LogDepegProductPaused(uint256 priceId, uint256 pausedAt);
event LogDepegProductUnpaused(uint256 priceId, uint256 unpausedAt);
event LogDepegBlockNumberSet(uint256 blockNumber, string comment);
event LogDepegDepegBalanceAdded(address wallet, uint256 blockNumber, uint256 balance);
event LogDepegDepegBalanceError(address wallet, uint256 blockNumber, uint256 balance, uint256 depeggedBlockNumber);
modifier onlyMatchingPolicy(bytes32 processId) {
}
modifier onlyProtectedWallet(bytes32 processId) {
}
constructor(
bytes32 productName,
address priceDataProvider,
address token,
address registry,
uint256 riskpoolId
)
Product(productName, token, POLICY_FLOW, riskpoolId, registry)
{
}
// TODO discuss: instead of sumInsured use sumProtected
// internally we could calulate with sumInsured = 0.25 * sumProtected (or whatever)
// this percentage (25% in the example above) needs to be used to
// cap claim amount should price feed fall below 1 - %value at depeggedAt
function applyForPolicyWithBundle(
address wallet,
uint256 protectedBalance,
uint256 duration,
uint256 bundleId
)
external
returns(bytes32 processId)
{
}
function getPolicyExpirationData(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(
bool isExpired,
uint256 expiredAt
)
{
}
function getDepeggedBlockNumber() public view returns(uint256 blockNumber) {
}
function setDepeggedBlockNumber(
uint256 blockNumber,
string memory comment
)
external
onlyOwner
{
}
function createDepegBalance(
address wallet,
uint256 blockNumber,
uint256 balance
)
public
view
returns(DepegBalance memory depegBalance)
{
}
function addDepegBalances(DepegBalance [] memory depegBalances)
external
onlyOwner
returns(
uint256 balanceOkCases,
uint256 balanceErrorCases
)
{
}
function getDepegBalance(address protectedWallet)
public
view
returns(DepegBalance memory depegBalance)
{
}
function getProcessedBalance(address protectedWallet)
public
view
returns(uint256 claimedBalance)
{
}
function hasDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(bool hasClaim)
{
}
function getDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(IPolicy.Claim memory claim)
{
}
function policyIsAllowedToClaim(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(bool mayClaim)
{
}
// onlyProtectedWallet modifier
// sets policy to expired
// creates claim if allowed
// reverts if not allowed
function createDepegClaim(bytes32 processId)
external
onlyMatchingPolicy(processId)
onlyProtectedWallet(processId)
{
}
function policiesToProcess() public view returns(uint256 numberOfPolicies) {
}
function getPolicyToProcess(uint256 idx)
public
view
returns(
bytes32 processId,
address wallet
)
{
}
// convencience function for frontend, api, ...
function getClaimData(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(
address wallet,
uint256 protectedAmount,
uint256 actualAmount,
bool hasClaim,
uint256 claimId,
IPolicy.ClaimState claimState,
uint256 claimAmount,
uint256 claimCreatedAt
)
{
}
// convenience function to speed up processing
function processPolicies(bytes32 [] memory _processIds)
external
{
}
// claim confirmation and payout handling for a single policy
// payout will be made to policy holder (not to protected wallet)
// this is a current limitation of the gif framework
function processPolicy(bytes32 processId)
public
{
require(<FILL_ME>)
_policiesWithOpenClaims.remove(processId);
_policiesWithConfirmedClaims.add(processId);
// get claim details
uint256 protectedAmount = getProtectedBalance(processId);
address protectedWallet = getProtectedWallet(processId);
require(_depegBalance[protectedWallet].blockNumber > 0, "ERROR:DP-043:DEPEG_BALANCE_MISSING");
require(_depegBalance[protectedWallet].balance > 0, "ERROR:DP-044:DEPEG_BALANCE_ZERO");
// deal with over insurance
// case A) of a single policy that covers more than the actual balance
uint256 depegBalance = _depegBalance[protectedWallet].balance;
// determine protected amount based on both protected amount from policy
// and actual balance at time of the depeg event
if(depegBalance < protectedAmount) {
emit LogDepegProtectedAmountReduction(processId, protectedAmount, depegBalance);
protectedAmount = depegBalance;
}
// deal with over insurance
// case B) several policies each <= depeg balance but summed up > depeg balance
// determine balance left to process
uint256 amountLeftToProcess = depegBalance - _processedBalance[protectedWallet];
require(amountLeftToProcess > 0, "ERROR:DP-045:PROTECTED_BALANCE_PROCESSED_ALREADY");
if(amountLeftToProcess < protectedAmount) {
emit LogDepegProcessedAmountReduction(processId, protectedAmount, amountLeftToProcess);
protectedAmount = amountLeftToProcess;
}
// update processed balance
_processedBalance[protectedWallet] += protectedAmount;
IPolicy.Claim memory claim = _getClaim(processId, CLAIM_ID);
uint256 payoutAmount = claim.claimAmount;
uint256 depegPayoutAmount = calculateClaimAmount(protectedAmount);
// down-adjust payout amount based on actual balance at depeg time
if(depegPayoutAmount < payoutAmount) {
payoutAmount = depegPayoutAmount;
}
// confirm claim
_confirmClaim(processId, CLAIM_ID, payoutAmount);
emit LogDepegClaimConfirmed(processId, CLAIM_ID, claim.claimAmount, depegBalance, payoutAmount);
// create and process payout
uint256 payoutId = _newPayout(processId, CLAIM_ID, payoutAmount, "");
_processPayout(processId, payoutId);
emit LogDepegPayoutProcessed(processId, CLAIM_ID, payoutId, payoutAmount);
// close policy
_close(processId);
emit LogDepegPolicyClosed(processId);
}
function getProtectedBalance(bytes32 processId) public view returns(uint256 protectedBalance) {
}
function encodeClaimInfoAsData(
uint256 depegPrice,
uint256 depeggedAt
)
public pure
returns (bytes memory data)
{
}
function decodeClaimInfoFromData(bytes memory data)
public pure
returns (
uint256 depegPrice,
uint256 depeggedAt
)
{
}
function calculateClaimAmount(uint256 tokenAmount)
public
view
returns(uint256 claimAmount)
{
}
// by circumventing prduct contract and directly updating usdc feed contract
function isNewPriceInfoEventAvailable()
external
view
returns(
bool newEvent,
IPriceDataProvider.PriceInfo memory priceInfo,
uint256 timeSinceEvent
)
{
}
function getDepegState() external view returns(DepegState state) {
}
function getLatestPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getDepegPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getTriggeredAt() external view returns(uint256 triggeredAt) {
}
function getDepeggedAt() external view returns(uint256 depeggedAt) {
}
function getTargetPrice() external view returns(uint256 targetPrice) {
}
// manage depeg product state machine: active, paused, depegged
function processLatestPriceInfo()
external
returns(IPriceDataProvider.PriceInfo memory priceInfo)
{
}
function reactivateProduct()
external
onlyOwner()
{
}
function calculateNetPremium(uint256 sumInsured, uint256 duration, uint256 bundleId) public view returns(uint256 netPremium) {
}
// TODO make this (well: TreasuryModule._calculateFee actually) available via instance service
function calculateFee(uint256 amount)
public
view
returns(uint256 feeAmount, uint256 totalAmount)
{
}
// TODO make this available via instance service
function getFeeSpecification(uint256 componentId)
public
view
returns(ITreasury.FeeSpecification memory feeSpecification)
{
}
function getFeeFractionFullUnit()
public
view
returns(uint256 fractionFullUnit)
{
}
// TODO this functionality should be provided by GIF (TreasuryModule)
function calculatePremium(uint256 netPremium) public view returns(uint256 premiumAmount) {
}
function processIds(address policyHolder)
external
view
returns(uint256 numberOfProcessIds)
{
}
function getProcessId(address policyHolder, uint256 idx)
external
view
returns(bytes32 processId)
{
}
function getProtectedWallet(bytes32 processId) public view returns(address wallet) {
}
function getPriceDataProvider() external view returns(address priceDataProvider) {
}
function getProtectedToken() external view returns(address protectedToken) {
}
function applications() external view returns(uint256 applicationCount) {
}
function getApplicationId(uint256 applicationIdx) external view returns(bytes32 processId) {
}
function policies() external view returns(uint256 policyCount) {
}
function getPolicyId(uint256 policyIdx) external view returns(bytes32 processId) {
}
function getApplicationDataStructure() external override pure returns(string memory dataStructure) {
}
}
| _policiesWithOpenClaims.contains(processId),"ERROR:DP-042:NOT_IN_PROCESS_SET" | 165,984 | _policiesWithOpenClaims.contains(processId) |
"ERROR:DP-043:DEPEG_BALANCE_MISSING" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.2;
import "EnumerableSet.sol";
import "IComponent.sol";
import "Product.sol";
import "IPolicy.sol";
import "ITreasury.sol";
import "TreasuryModule.sol";
import "IPriceDataProvider.sol";
import "DepegRiskpool.sol";
contract DepegProduct is
Product
{
using EnumerableSet for EnumerableSet.Bytes32Set;
enum DepegState {
Undefined,
Active, // normal operation
Paused, // stop selling policies, might recover to active
Depegged // stop selling policies, manual reset to active needed by owner
}
struct DepegBalance {
address wallet;
uint256 blockNumber;
uint256 balance;
}
uint256 public constant MAINNET = 1;
uint256 public constant GANACHE = 1337;
bytes32 public constant NAME = "DepegProduct";
bytes32 public constant VERSION = "0.1";
bytes32 public constant POLICY_FLOW = "PolicyDefaultFlow";
// constant as each policy has max 1 claim
uint256 public constant CLAIM_ID = 0;
bytes32 [] private _applications;
bytes32 [] private _policies;
// holds policies that created a depeg claim
EnumerableSet.Bytes32Set private _policiesWithOpenClaims;
EnumerableSet.Bytes32Set private _policiesWithConfirmedClaims;
IPriceDataProvider private _priceDataProvider;
address private _protectedToken;
DepegState private _state;
DepegRiskpool private _riskpool;
TreasuryModule private _treasury;
uint256 private _depeggedBlockNumber;
// hold list of applications/policies for address
mapping(address /* policyHolder */ => bytes32 [] /* processIds */) private _processIdsForHolder;
// actual wallet balances at depeg time
mapping(address /* wallet */ => DepegBalance /* balance */) private _depegBalance;
// processed wallet balances
mapping(address /* wallet */ => uint256 /* processed total claims so far */) private _processedBalance;
event LogDepegApplicationCreated(bytes32 processId, address policyHolder, address protectedWallet, uint256 protectedBalance, uint256 sumInsuredAmount, uint256 premiumAmount, uint256 netPremiumAmount);
event LogDepegPolicyCreated(bytes32 processId, address policyHolder, uint256 sumInsuredAmount);
event LogDepegClaimCreated(bytes32 processId, uint256 claimId, uint256 claimAmount);
event LogDepegProtectedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 depegBalance);
event LogDepegProcessedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 amountLeftToProcess);
event LogDepegClaimConfirmed(bytes32 processId, uint256 claimId, uint256 claimAmount, uint256 accountBalance, uint256 payoutAmount);
event LogDepegPayoutProcessed(bytes32 processId, uint256 claimId, uint256 payoutId, uint256 payoutAmount);
event LogDepegPolicyExpired(bytes32 processId);
event LogDepegPolicyClosed(bytes32 processId);
event LogDepegPriceEvent(
uint256 priceId,
uint256 price,
IPriceDataProvider.EventType eventType,
uint256 triggeredAt,
uint256 depeggedAt,
uint256 createdAt
);
event LogDepegProductDeactivated(uint256 priceId, uint256 deactivatedAt);
event LogDepegProductReactivated(uint256 reactivatedAt);
event LogDepegProductPaused(uint256 priceId, uint256 pausedAt);
event LogDepegProductUnpaused(uint256 priceId, uint256 unpausedAt);
event LogDepegBlockNumberSet(uint256 blockNumber, string comment);
event LogDepegDepegBalanceAdded(address wallet, uint256 blockNumber, uint256 balance);
event LogDepegDepegBalanceError(address wallet, uint256 blockNumber, uint256 balance, uint256 depeggedBlockNumber);
modifier onlyMatchingPolicy(bytes32 processId) {
}
modifier onlyProtectedWallet(bytes32 processId) {
}
constructor(
bytes32 productName,
address priceDataProvider,
address token,
address registry,
uint256 riskpoolId
)
Product(productName, token, POLICY_FLOW, riskpoolId, registry)
{
}
// TODO discuss: instead of sumInsured use sumProtected
// internally we could calulate with sumInsured = 0.25 * sumProtected (or whatever)
// this percentage (25% in the example above) needs to be used to
// cap claim amount should price feed fall below 1 - %value at depeggedAt
function applyForPolicyWithBundle(
address wallet,
uint256 protectedBalance,
uint256 duration,
uint256 bundleId
)
external
returns(bytes32 processId)
{
}
function getPolicyExpirationData(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(
bool isExpired,
uint256 expiredAt
)
{
}
function getDepeggedBlockNumber() public view returns(uint256 blockNumber) {
}
function setDepeggedBlockNumber(
uint256 blockNumber,
string memory comment
)
external
onlyOwner
{
}
function createDepegBalance(
address wallet,
uint256 blockNumber,
uint256 balance
)
public
view
returns(DepegBalance memory depegBalance)
{
}
function addDepegBalances(DepegBalance [] memory depegBalances)
external
onlyOwner
returns(
uint256 balanceOkCases,
uint256 balanceErrorCases
)
{
}
function getDepegBalance(address protectedWallet)
public
view
returns(DepegBalance memory depegBalance)
{
}
function getProcessedBalance(address protectedWallet)
public
view
returns(uint256 claimedBalance)
{
}
function hasDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(bool hasClaim)
{
}
function getDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(IPolicy.Claim memory claim)
{
}
function policyIsAllowedToClaim(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(bool mayClaim)
{
}
// onlyProtectedWallet modifier
// sets policy to expired
// creates claim if allowed
// reverts if not allowed
function createDepegClaim(bytes32 processId)
external
onlyMatchingPolicy(processId)
onlyProtectedWallet(processId)
{
}
function policiesToProcess() public view returns(uint256 numberOfPolicies) {
}
function getPolicyToProcess(uint256 idx)
public
view
returns(
bytes32 processId,
address wallet
)
{
}
// convencience function for frontend, api, ...
function getClaimData(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(
address wallet,
uint256 protectedAmount,
uint256 actualAmount,
bool hasClaim,
uint256 claimId,
IPolicy.ClaimState claimState,
uint256 claimAmount,
uint256 claimCreatedAt
)
{
}
// convenience function to speed up processing
function processPolicies(bytes32 [] memory _processIds)
external
{
}
// claim confirmation and payout handling for a single policy
// payout will be made to policy holder (not to protected wallet)
// this is a current limitation of the gif framework
function processPolicy(bytes32 processId)
public
{
require(_policiesWithOpenClaims.contains(processId), "ERROR:DP-042:NOT_IN_PROCESS_SET");
_policiesWithOpenClaims.remove(processId);
_policiesWithConfirmedClaims.add(processId);
// get claim details
uint256 protectedAmount = getProtectedBalance(processId);
address protectedWallet = getProtectedWallet(processId);
require(<FILL_ME>)
require(_depegBalance[protectedWallet].balance > 0, "ERROR:DP-044:DEPEG_BALANCE_ZERO");
// deal with over insurance
// case A) of a single policy that covers more than the actual balance
uint256 depegBalance = _depegBalance[protectedWallet].balance;
// determine protected amount based on both protected amount from policy
// and actual balance at time of the depeg event
if(depegBalance < protectedAmount) {
emit LogDepegProtectedAmountReduction(processId, protectedAmount, depegBalance);
protectedAmount = depegBalance;
}
// deal with over insurance
// case B) several policies each <= depeg balance but summed up > depeg balance
// determine balance left to process
uint256 amountLeftToProcess = depegBalance - _processedBalance[protectedWallet];
require(amountLeftToProcess > 0, "ERROR:DP-045:PROTECTED_BALANCE_PROCESSED_ALREADY");
if(amountLeftToProcess < protectedAmount) {
emit LogDepegProcessedAmountReduction(processId, protectedAmount, amountLeftToProcess);
protectedAmount = amountLeftToProcess;
}
// update processed balance
_processedBalance[protectedWallet] += protectedAmount;
IPolicy.Claim memory claim = _getClaim(processId, CLAIM_ID);
uint256 payoutAmount = claim.claimAmount;
uint256 depegPayoutAmount = calculateClaimAmount(protectedAmount);
// down-adjust payout amount based on actual balance at depeg time
if(depegPayoutAmount < payoutAmount) {
payoutAmount = depegPayoutAmount;
}
// confirm claim
_confirmClaim(processId, CLAIM_ID, payoutAmount);
emit LogDepegClaimConfirmed(processId, CLAIM_ID, claim.claimAmount, depegBalance, payoutAmount);
// create and process payout
uint256 payoutId = _newPayout(processId, CLAIM_ID, payoutAmount, "");
_processPayout(processId, payoutId);
emit LogDepegPayoutProcessed(processId, CLAIM_ID, payoutId, payoutAmount);
// close policy
_close(processId);
emit LogDepegPolicyClosed(processId);
}
function getProtectedBalance(bytes32 processId) public view returns(uint256 protectedBalance) {
}
function encodeClaimInfoAsData(
uint256 depegPrice,
uint256 depeggedAt
)
public pure
returns (bytes memory data)
{
}
function decodeClaimInfoFromData(bytes memory data)
public pure
returns (
uint256 depegPrice,
uint256 depeggedAt
)
{
}
function calculateClaimAmount(uint256 tokenAmount)
public
view
returns(uint256 claimAmount)
{
}
// by circumventing prduct contract and directly updating usdc feed contract
function isNewPriceInfoEventAvailable()
external
view
returns(
bool newEvent,
IPriceDataProvider.PriceInfo memory priceInfo,
uint256 timeSinceEvent
)
{
}
function getDepegState() external view returns(DepegState state) {
}
function getLatestPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getDepegPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getTriggeredAt() external view returns(uint256 triggeredAt) {
}
function getDepeggedAt() external view returns(uint256 depeggedAt) {
}
function getTargetPrice() external view returns(uint256 targetPrice) {
}
// manage depeg product state machine: active, paused, depegged
function processLatestPriceInfo()
external
returns(IPriceDataProvider.PriceInfo memory priceInfo)
{
}
function reactivateProduct()
external
onlyOwner()
{
}
function calculateNetPremium(uint256 sumInsured, uint256 duration, uint256 bundleId) public view returns(uint256 netPremium) {
}
// TODO make this (well: TreasuryModule._calculateFee actually) available via instance service
function calculateFee(uint256 amount)
public
view
returns(uint256 feeAmount, uint256 totalAmount)
{
}
// TODO make this available via instance service
function getFeeSpecification(uint256 componentId)
public
view
returns(ITreasury.FeeSpecification memory feeSpecification)
{
}
function getFeeFractionFullUnit()
public
view
returns(uint256 fractionFullUnit)
{
}
// TODO this functionality should be provided by GIF (TreasuryModule)
function calculatePremium(uint256 netPremium) public view returns(uint256 premiumAmount) {
}
function processIds(address policyHolder)
external
view
returns(uint256 numberOfProcessIds)
{
}
function getProcessId(address policyHolder, uint256 idx)
external
view
returns(bytes32 processId)
{
}
function getProtectedWallet(bytes32 processId) public view returns(address wallet) {
}
function getPriceDataProvider() external view returns(address priceDataProvider) {
}
function getProtectedToken() external view returns(address protectedToken) {
}
function applications() external view returns(uint256 applicationCount) {
}
function getApplicationId(uint256 applicationIdx) external view returns(bytes32 processId) {
}
function policies() external view returns(uint256 policyCount) {
}
function getPolicyId(uint256 policyIdx) external view returns(bytes32 processId) {
}
function getApplicationDataStructure() external override pure returns(string memory dataStructure) {
}
}
| _depegBalance[protectedWallet].blockNumber>0,"ERROR:DP-043:DEPEG_BALANCE_MISSING" | 165,984 | _depegBalance[protectedWallet].blockNumber>0 |
"ERROR:DP-044:DEPEG_BALANCE_ZERO" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.2;
import "EnumerableSet.sol";
import "IComponent.sol";
import "Product.sol";
import "IPolicy.sol";
import "ITreasury.sol";
import "TreasuryModule.sol";
import "IPriceDataProvider.sol";
import "DepegRiskpool.sol";
contract DepegProduct is
Product
{
using EnumerableSet for EnumerableSet.Bytes32Set;
enum DepegState {
Undefined,
Active, // normal operation
Paused, // stop selling policies, might recover to active
Depegged // stop selling policies, manual reset to active needed by owner
}
struct DepegBalance {
address wallet;
uint256 blockNumber;
uint256 balance;
}
uint256 public constant MAINNET = 1;
uint256 public constant GANACHE = 1337;
bytes32 public constant NAME = "DepegProduct";
bytes32 public constant VERSION = "0.1";
bytes32 public constant POLICY_FLOW = "PolicyDefaultFlow";
// constant as each policy has max 1 claim
uint256 public constant CLAIM_ID = 0;
bytes32 [] private _applications;
bytes32 [] private _policies;
// holds policies that created a depeg claim
EnumerableSet.Bytes32Set private _policiesWithOpenClaims;
EnumerableSet.Bytes32Set private _policiesWithConfirmedClaims;
IPriceDataProvider private _priceDataProvider;
address private _protectedToken;
DepegState private _state;
DepegRiskpool private _riskpool;
TreasuryModule private _treasury;
uint256 private _depeggedBlockNumber;
// hold list of applications/policies for address
mapping(address /* policyHolder */ => bytes32 [] /* processIds */) private _processIdsForHolder;
// actual wallet balances at depeg time
mapping(address /* wallet */ => DepegBalance /* balance */) private _depegBalance;
// processed wallet balances
mapping(address /* wallet */ => uint256 /* processed total claims so far */) private _processedBalance;
event LogDepegApplicationCreated(bytes32 processId, address policyHolder, address protectedWallet, uint256 protectedBalance, uint256 sumInsuredAmount, uint256 premiumAmount, uint256 netPremiumAmount);
event LogDepegPolicyCreated(bytes32 processId, address policyHolder, uint256 sumInsuredAmount);
event LogDepegClaimCreated(bytes32 processId, uint256 claimId, uint256 claimAmount);
event LogDepegProtectedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 depegBalance);
event LogDepegProcessedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 amountLeftToProcess);
event LogDepegClaimConfirmed(bytes32 processId, uint256 claimId, uint256 claimAmount, uint256 accountBalance, uint256 payoutAmount);
event LogDepegPayoutProcessed(bytes32 processId, uint256 claimId, uint256 payoutId, uint256 payoutAmount);
event LogDepegPolicyExpired(bytes32 processId);
event LogDepegPolicyClosed(bytes32 processId);
event LogDepegPriceEvent(
uint256 priceId,
uint256 price,
IPriceDataProvider.EventType eventType,
uint256 triggeredAt,
uint256 depeggedAt,
uint256 createdAt
);
event LogDepegProductDeactivated(uint256 priceId, uint256 deactivatedAt);
event LogDepegProductReactivated(uint256 reactivatedAt);
event LogDepegProductPaused(uint256 priceId, uint256 pausedAt);
event LogDepegProductUnpaused(uint256 priceId, uint256 unpausedAt);
event LogDepegBlockNumberSet(uint256 blockNumber, string comment);
event LogDepegDepegBalanceAdded(address wallet, uint256 blockNumber, uint256 balance);
event LogDepegDepegBalanceError(address wallet, uint256 blockNumber, uint256 balance, uint256 depeggedBlockNumber);
modifier onlyMatchingPolicy(bytes32 processId) {
}
modifier onlyProtectedWallet(bytes32 processId) {
}
constructor(
bytes32 productName,
address priceDataProvider,
address token,
address registry,
uint256 riskpoolId
)
Product(productName, token, POLICY_FLOW, riskpoolId, registry)
{
}
// TODO discuss: instead of sumInsured use sumProtected
// internally we could calulate with sumInsured = 0.25 * sumProtected (or whatever)
// this percentage (25% in the example above) needs to be used to
// cap claim amount should price feed fall below 1 - %value at depeggedAt
function applyForPolicyWithBundle(
address wallet,
uint256 protectedBalance,
uint256 duration,
uint256 bundleId
)
external
returns(bytes32 processId)
{
}
function getPolicyExpirationData(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(
bool isExpired,
uint256 expiredAt
)
{
}
function getDepeggedBlockNumber() public view returns(uint256 blockNumber) {
}
function setDepeggedBlockNumber(
uint256 blockNumber,
string memory comment
)
external
onlyOwner
{
}
function createDepegBalance(
address wallet,
uint256 blockNumber,
uint256 balance
)
public
view
returns(DepegBalance memory depegBalance)
{
}
function addDepegBalances(DepegBalance [] memory depegBalances)
external
onlyOwner
returns(
uint256 balanceOkCases,
uint256 balanceErrorCases
)
{
}
function getDepegBalance(address protectedWallet)
public
view
returns(DepegBalance memory depegBalance)
{
}
function getProcessedBalance(address protectedWallet)
public
view
returns(uint256 claimedBalance)
{
}
function hasDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(bool hasClaim)
{
}
function getDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(IPolicy.Claim memory claim)
{
}
function policyIsAllowedToClaim(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(bool mayClaim)
{
}
// onlyProtectedWallet modifier
// sets policy to expired
// creates claim if allowed
// reverts if not allowed
function createDepegClaim(bytes32 processId)
external
onlyMatchingPolicy(processId)
onlyProtectedWallet(processId)
{
}
function policiesToProcess() public view returns(uint256 numberOfPolicies) {
}
function getPolicyToProcess(uint256 idx)
public
view
returns(
bytes32 processId,
address wallet
)
{
}
// convencience function for frontend, api, ...
function getClaimData(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(
address wallet,
uint256 protectedAmount,
uint256 actualAmount,
bool hasClaim,
uint256 claimId,
IPolicy.ClaimState claimState,
uint256 claimAmount,
uint256 claimCreatedAt
)
{
}
// convenience function to speed up processing
function processPolicies(bytes32 [] memory _processIds)
external
{
}
// claim confirmation and payout handling for a single policy
// payout will be made to policy holder (not to protected wallet)
// this is a current limitation of the gif framework
function processPolicy(bytes32 processId)
public
{
require(_policiesWithOpenClaims.contains(processId), "ERROR:DP-042:NOT_IN_PROCESS_SET");
_policiesWithOpenClaims.remove(processId);
_policiesWithConfirmedClaims.add(processId);
// get claim details
uint256 protectedAmount = getProtectedBalance(processId);
address protectedWallet = getProtectedWallet(processId);
require(_depegBalance[protectedWallet].blockNumber > 0, "ERROR:DP-043:DEPEG_BALANCE_MISSING");
require(<FILL_ME>)
// deal with over insurance
// case A) of a single policy that covers more than the actual balance
uint256 depegBalance = _depegBalance[protectedWallet].balance;
// determine protected amount based on both protected amount from policy
// and actual balance at time of the depeg event
if(depegBalance < protectedAmount) {
emit LogDepegProtectedAmountReduction(processId, protectedAmount, depegBalance);
protectedAmount = depegBalance;
}
// deal with over insurance
// case B) several policies each <= depeg balance but summed up > depeg balance
// determine balance left to process
uint256 amountLeftToProcess = depegBalance - _processedBalance[protectedWallet];
require(amountLeftToProcess > 0, "ERROR:DP-045:PROTECTED_BALANCE_PROCESSED_ALREADY");
if(amountLeftToProcess < protectedAmount) {
emit LogDepegProcessedAmountReduction(processId, protectedAmount, amountLeftToProcess);
protectedAmount = amountLeftToProcess;
}
// update processed balance
_processedBalance[protectedWallet] += protectedAmount;
IPolicy.Claim memory claim = _getClaim(processId, CLAIM_ID);
uint256 payoutAmount = claim.claimAmount;
uint256 depegPayoutAmount = calculateClaimAmount(protectedAmount);
// down-adjust payout amount based on actual balance at depeg time
if(depegPayoutAmount < payoutAmount) {
payoutAmount = depegPayoutAmount;
}
// confirm claim
_confirmClaim(processId, CLAIM_ID, payoutAmount);
emit LogDepegClaimConfirmed(processId, CLAIM_ID, claim.claimAmount, depegBalance, payoutAmount);
// create and process payout
uint256 payoutId = _newPayout(processId, CLAIM_ID, payoutAmount, "");
_processPayout(processId, payoutId);
emit LogDepegPayoutProcessed(processId, CLAIM_ID, payoutId, payoutAmount);
// close policy
_close(processId);
emit LogDepegPolicyClosed(processId);
}
function getProtectedBalance(bytes32 processId) public view returns(uint256 protectedBalance) {
}
function encodeClaimInfoAsData(
uint256 depegPrice,
uint256 depeggedAt
)
public pure
returns (bytes memory data)
{
}
function decodeClaimInfoFromData(bytes memory data)
public pure
returns (
uint256 depegPrice,
uint256 depeggedAt
)
{
}
function calculateClaimAmount(uint256 tokenAmount)
public
view
returns(uint256 claimAmount)
{
}
// by circumventing prduct contract and directly updating usdc feed contract
function isNewPriceInfoEventAvailable()
external
view
returns(
bool newEvent,
IPriceDataProvider.PriceInfo memory priceInfo,
uint256 timeSinceEvent
)
{
}
function getDepegState() external view returns(DepegState state) {
}
function getLatestPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getDepegPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getTriggeredAt() external view returns(uint256 triggeredAt) {
}
function getDepeggedAt() external view returns(uint256 depeggedAt) {
}
function getTargetPrice() external view returns(uint256 targetPrice) {
}
// manage depeg product state machine: active, paused, depegged
function processLatestPriceInfo()
external
returns(IPriceDataProvider.PriceInfo memory priceInfo)
{
}
function reactivateProduct()
external
onlyOwner()
{
}
function calculateNetPremium(uint256 sumInsured, uint256 duration, uint256 bundleId) public view returns(uint256 netPremium) {
}
// TODO make this (well: TreasuryModule._calculateFee actually) available via instance service
function calculateFee(uint256 amount)
public
view
returns(uint256 feeAmount, uint256 totalAmount)
{
}
// TODO make this available via instance service
function getFeeSpecification(uint256 componentId)
public
view
returns(ITreasury.FeeSpecification memory feeSpecification)
{
}
function getFeeFractionFullUnit()
public
view
returns(uint256 fractionFullUnit)
{
}
// TODO this functionality should be provided by GIF (TreasuryModule)
function calculatePremium(uint256 netPremium) public view returns(uint256 premiumAmount) {
}
function processIds(address policyHolder)
external
view
returns(uint256 numberOfProcessIds)
{
}
function getProcessId(address policyHolder, uint256 idx)
external
view
returns(bytes32 processId)
{
}
function getProtectedWallet(bytes32 processId) public view returns(address wallet) {
}
function getPriceDataProvider() external view returns(address priceDataProvider) {
}
function getProtectedToken() external view returns(address protectedToken) {
}
function applications() external view returns(uint256 applicationCount) {
}
function getApplicationId(uint256 applicationIdx) external view returns(bytes32 processId) {
}
function policies() external view returns(uint256 policyCount) {
}
function getPolicyId(uint256 policyIdx) external view returns(bytes32 processId) {
}
function getApplicationDataStructure() external override pure returns(string memory dataStructure) {
}
}
| _depegBalance[protectedWallet].balance>0,"ERROR:DP-044:DEPEG_BALANCE_ZERO" | 165,984 | _depegBalance[protectedWallet].balance>0 |
"ERROR:DP-060:NOT_TESTNET" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.2;
import "EnumerableSet.sol";
import "IComponent.sol";
import "Product.sol";
import "IPolicy.sol";
import "ITreasury.sol";
import "TreasuryModule.sol";
import "IPriceDataProvider.sol";
import "DepegRiskpool.sol";
contract DepegProduct is
Product
{
using EnumerableSet for EnumerableSet.Bytes32Set;
enum DepegState {
Undefined,
Active, // normal operation
Paused, // stop selling policies, might recover to active
Depegged // stop selling policies, manual reset to active needed by owner
}
struct DepegBalance {
address wallet;
uint256 blockNumber;
uint256 balance;
}
uint256 public constant MAINNET = 1;
uint256 public constant GANACHE = 1337;
bytes32 public constant NAME = "DepegProduct";
bytes32 public constant VERSION = "0.1";
bytes32 public constant POLICY_FLOW = "PolicyDefaultFlow";
// constant as each policy has max 1 claim
uint256 public constant CLAIM_ID = 0;
bytes32 [] private _applications;
bytes32 [] private _policies;
// holds policies that created a depeg claim
EnumerableSet.Bytes32Set private _policiesWithOpenClaims;
EnumerableSet.Bytes32Set private _policiesWithConfirmedClaims;
IPriceDataProvider private _priceDataProvider;
address private _protectedToken;
DepegState private _state;
DepegRiskpool private _riskpool;
TreasuryModule private _treasury;
uint256 private _depeggedBlockNumber;
// hold list of applications/policies for address
mapping(address /* policyHolder */ => bytes32 [] /* processIds */) private _processIdsForHolder;
// actual wallet balances at depeg time
mapping(address /* wallet */ => DepegBalance /* balance */) private _depegBalance;
// processed wallet balances
mapping(address /* wallet */ => uint256 /* processed total claims so far */) private _processedBalance;
event LogDepegApplicationCreated(bytes32 processId, address policyHolder, address protectedWallet, uint256 protectedBalance, uint256 sumInsuredAmount, uint256 premiumAmount, uint256 netPremiumAmount);
event LogDepegPolicyCreated(bytes32 processId, address policyHolder, uint256 sumInsuredAmount);
event LogDepegClaimCreated(bytes32 processId, uint256 claimId, uint256 claimAmount);
event LogDepegProtectedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 depegBalance);
event LogDepegProcessedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 amountLeftToProcess);
event LogDepegClaimConfirmed(bytes32 processId, uint256 claimId, uint256 claimAmount, uint256 accountBalance, uint256 payoutAmount);
event LogDepegPayoutProcessed(bytes32 processId, uint256 claimId, uint256 payoutId, uint256 payoutAmount);
event LogDepegPolicyExpired(bytes32 processId);
event LogDepegPolicyClosed(bytes32 processId);
event LogDepegPriceEvent(
uint256 priceId,
uint256 price,
IPriceDataProvider.EventType eventType,
uint256 triggeredAt,
uint256 depeggedAt,
uint256 createdAt
);
event LogDepegProductDeactivated(uint256 priceId, uint256 deactivatedAt);
event LogDepegProductReactivated(uint256 reactivatedAt);
event LogDepegProductPaused(uint256 priceId, uint256 pausedAt);
event LogDepegProductUnpaused(uint256 priceId, uint256 unpausedAt);
event LogDepegBlockNumberSet(uint256 blockNumber, string comment);
event LogDepegDepegBalanceAdded(address wallet, uint256 blockNumber, uint256 balance);
event LogDepegDepegBalanceError(address wallet, uint256 blockNumber, uint256 balance, uint256 depeggedBlockNumber);
modifier onlyMatchingPolicy(bytes32 processId) {
}
modifier onlyProtectedWallet(bytes32 processId) {
}
constructor(
bytes32 productName,
address priceDataProvider,
address token,
address registry,
uint256 riskpoolId
)
Product(productName, token, POLICY_FLOW, riskpoolId, registry)
{
}
// TODO discuss: instead of sumInsured use sumProtected
// internally we could calulate with sumInsured = 0.25 * sumProtected (or whatever)
// this percentage (25% in the example above) needs to be used to
// cap claim amount should price feed fall below 1 - %value at depeggedAt
function applyForPolicyWithBundle(
address wallet,
uint256 protectedBalance,
uint256 duration,
uint256 bundleId
)
external
returns(bytes32 processId)
{
}
function getPolicyExpirationData(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(
bool isExpired,
uint256 expiredAt
)
{
}
function getDepeggedBlockNumber() public view returns(uint256 blockNumber) {
}
function setDepeggedBlockNumber(
uint256 blockNumber,
string memory comment
)
external
onlyOwner
{
}
function createDepegBalance(
address wallet,
uint256 blockNumber,
uint256 balance
)
public
view
returns(DepegBalance memory depegBalance)
{
}
function addDepegBalances(DepegBalance [] memory depegBalances)
external
onlyOwner
returns(
uint256 balanceOkCases,
uint256 balanceErrorCases
)
{
}
function getDepegBalance(address protectedWallet)
public
view
returns(DepegBalance memory depegBalance)
{
}
function getProcessedBalance(address protectedWallet)
public
view
returns(uint256 claimedBalance)
{
}
function hasDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(bool hasClaim)
{
}
function getDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(IPolicy.Claim memory claim)
{
}
function policyIsAllowedToClaim(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(bool mayClaim)
{
}
// onlyProtectedWallet modifier
// sets policy to expired
// creates claim if allowed
// reverts if not allowed
function createDepegClaim(bytes32 processId)
external
onlyMatchingPolicy(processId)
onlyProtectedWallet(processId)
{
}
function policiesToProcess() public view returns(uint256 numberOfPolicies) {
}
function getPolicyToProcess(uint256 idx)
public
view
returns(
bytes32 processId,
address wallet
)
{
}
// convencience function for frontend, api, ...
function getClaimData(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(
address wallet,
uint256 protectedAmount,
uint256 actualAmount,
bool hasClaim,
uint256 claimId,
IPolicy.ClaimState claimState,
uint256 claimAmount,
uint256 claimCreatedAt
)
{
}
// convenience function to speed up processing
function processPolicies(bytes32 [] memory _processIds)
external
{
}
// claim confirmation and payout handling for a single policy
// payout will be made to policy holder (not to protected wallet)
// this is a current limitation of the gif framework
function processPolicy(bytes32 processId)
public
{
}
function getProtectedBalance(bytes32 processId) public view returns(uint256 protectedBalance) {
}
function encodeClaimInfoAsData(
uint256 depegPrice,
uint256 depeggedAt
)
public pure
returns (bytes memory data)
{
}
function decodeClaimInfoFromData(bytes memory data)
public pure
returns (
uint256 depegPrice,
uint256 depeggedAt
)
{
}
function calculateClaimAmount(uint256 tokenAmount)
public
view
returns(uint256 claimAmount)
{
}
// by circumventing prduct contract and directly updating usdc feed contract
function isNewPriceInfoEventAvailable()
external
view
returns(
bool newEvent,
IPriceDataProvider.PriceInfo memory priceInfo,
uint256 timeSinceEvent
)
{
}
function getDepegState() external view returns(DepegState state) {
}
function getLatestPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getDepegPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getTriggeredAt() external view returns(uint256 triggeredAt) {
}
function getDepeggedAt() external view returns(uint256 depeggedAt) {
}
function getTargetPrice() external view returns(uint256 targetPrice) {
}
// manage depeg product state machine: active, paused, depegged
function processLatestPriceInfo()
external
returns(IPriceDataProvider.PriceInfo memory priceInfo)
{
}
function reactivateProduct()
external
onlyOwner()
{
require(<FILL_ME>)
_state = DepegState.Active;
emit LogDepegProductReactivated(block.timestamp);
}
function calculateNetPremium(uint256 sumInsured, uint256 duration, uint256 bundleId) public view returns(uint256 netPremium) {
}
// TODO make this (well: TreasuryModule._calculateFee actually) available via instance service
function calculateFee(uint256 amount)
public
view
returns(uint256 feeAmount, uint256 totalAmount)
{
}
// TODO make this available via instance service
function getFeeSpecification(uint256 componentId)
public
view
returns(ITreasury.FeeSpecification memory feeSpecification)
{
}
function getFeeFractionFullUnit()
public
view
returns(uint256 fractionFullUnit)
{
}
// TODO this functionality should be provided by GIF (TreasuryModule)
function calculatePremium(uint256 netPremium) public view returns(uint256 premiumAmount) {
}
function processIds(address policyHolder)
external
view
returns(uint256 numberOfProcessIds)
{
}
function getProcessId(address policyHolder, uint256 idx)
external
view
returns(bytes32 processId)
{
}
function getProtectedWallet(bytes32 processId) public view returns(address wallet) {
}
function getPriceDataProvider() external view returns(address priceDataProvider) {
}
function getProtectedToken() external view returns(address protectedToken) {
}
function applications() external view returns(uint256 applicationCount) {
}
function getApplicationId(uint256 applicationIdx) external view returns(bytes32 processId) {
}
function policies() external view returns(uint256 policyCount) {
}
function getPolicyId(uint256 policyIdx) external view returns(bytes32 processId) {
}
function getApplicationDataStructure() external override pure returns(string memory dataStructure) {
}
}
| _priceDataProvider.isTestnetProvider(),"ERROR:DP-060:NOT_TESTNET" | 165,984 | _priceDataProvider.isTestnetProvider() |
"ERROR:DP-070:NO_POLICIES" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.2;
import "EnumerableSet.sol";
import "IComponent.sol";
import "Product.sol";
import "IPolicy.sol";
import "ITreasury.sol";
import "TreasuryModule.sol";
import "IPriceDataProvider.sol";
import "DepegRiskpool.sol";
contract DepegProduct is
Product
{
using EnumerableSet for EnumerableSet.Bytes32Set;
enum DepegState {
Undefined,
Active, // normal operation
Paused, // stop selling policies, might recover to active
Depegged // stop selling policies, manual reset to active needed by owner
}
struct DepegBalance {
address wallet;
uint256 blockNumber;
uint256 balance;
}
uint256 public constant MAINNET = 1;
uint256 public constant GANACHE = 1337;
bytes32 public constant NAME = "DepegProduct";
bytes32 public constant VERSION = "0.1";
bytes32 public constant POLICY_FLOW = "PolicyDefaultFlow";
// constant as each policy has max 1 claim
uint256 public constant CLAIM_ID = 0;
bytes32 [] private _applications;
bytes32 [] private _policies;
// holds policies that created a depeg claim
EnumerableSet.Bytes32Set private _policiesWithOpenClaims;
EnumerableSet.Bytes32Set private _policiesWithConfirmedClaims;
IPriceDataProvider private _priceDataProvider;
address private _protectedToken;
DepegState private _state;
DepegRiskpool private _riskpool;
TreasuryModule private _treasury;
uint256 private _depeggedBlockNumber;
// hold list of applications/policies for address
mapping(address /* policyHolder */ => bytes32 [] /* processIds */) private _processIdsForHolder;
// actual wallet balances at depeg time
mapping(address /* wallet */ => DepegBalance /* balance */) private _depegBalance;
// processed wallet balances
mapping(address /* wallet */ => uint256 /* processed total claims so far */) private _processedBalance;
event LogDepegApplicationCreated(bytes32 processId, address policyHolder, address protectedWallet, uint256 protectedBalance, uint256 sumInsuredAmount, uint256 premiumAmount, uint256 netPremiumAmount);
event LogDepegPolicyCreated(bytes32 processId, address policyHolder, uint256 sumInsuredAmount);
event LogDepegClaimCreated(bytes32 processId, uint256 claimId, uint256 claimAmount);
event LogDepegProtectedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 depegBalance);
event LogDepegProcessedAmountReduction(bytes32 processId, uint256 protectedAmount, uint256 amountLeftToProcess);
event LogDepegClaimConfirmed(bytes32 processId, uint256 claimId, uint256 claimAmount, uint256 accountBalance, uint256 payoutAmount);
event LogDepegPayoutProcessed(bytes32 processId, uint256 claimId, uint256 payoutId, uint256 payoutAmount);
event LogDepegPolicyExpired(bytes32 processId);
event LogDepegPolicyClosed(bytes32 processId);
event LogDepegPriceEvent(
uint256 priceId,
uint256 price,
IPriceDataProvider.EventType eventType,
uint256 triggeredAt,
uint256 depeggedAt,
uint256 createdAt
);
event LogDepegProductDeactivated(uint256 priceId, uint256 deactivatedAt);
event LogDepegProductReactivated(uint256 reactivatedAt);
event LogDepegProductPaused(uint256 priceId, uint256 pausedAt);
event LogDepegProductUnpaused(uint256 priceId, uint256 unpausedAt);
event LogDepegBlockNumberSet(uint256 blockNumber, string comment);
event LogDepegDepegBalanceAdded(address wallet, uint256 blockNumber, uint256 balance);
event LogDepegDepegBalanceError(address wallet, uint256 blockNumber, uint256 balance, uint256 depeggedBlockNumber);
modifier onlyMatchingPolicy(bytes32 processId) {
}
modifier onlyProtectedWallet(bytes32 processId) {
}
constructor(
bytes32 productName,
address priceDataProvider,
address token,
address registry,
uint256 riskpoolId
)
Product(productName, token, POLICY_FLOW, riskpoolId, registry)
{
}
// TODO discuss: instead of sumInsured use sumProtected
// internally we could calulate with sumInsured = 0.25 * sumProtected (or whatever)
// this percentage (25% in the example above) needs to be used to
// cap claim amount should price feed fall below 1 - %value at depeggedAt
function applyForPolicyWithBundle(
address wallet,
uint256 protectedBalance,
uint256 duration,
uint256 bundleId
)
external
returns(bytes32 processId)
{
}
function getPolicyExpirationData(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(
bool isExpired,
uint256 expiredAt
)
{
}
function getDepeggedBlockNumber() public view returns(uint256 blockNumber) {
}
function setDepeggedBlockNumber(
uint256 blockNumber,
string memory comment
)
external
onlyOwner
{
}
function createDepegBalance(
address wallet,
uint256 blockNumber,
uint256 balance
)
public
view
returns(DepegBalance memory depegBalance)
{
}
function addDepegBalances(DepegBalance [] memory depegBalances)
external
onlyOwner
returns(
uint256 balanceOkCases,
uint256 balanceErrorCases
)
{
}
function getDepegBalance(address protectedWallet)
public
view
returns(DepegBalance memory depegBalance)
{
}
function getProcessedBalance(address protectedWallet)
public
view
returns(uint256 claimedBalance)
{
}
function hasDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(bool hasClaim)
{
}
function getDepegClaim(bytes32 processId)
public
view
onlyMatchingPolicy(processId)
returns(IPolicy.Claim memory claim)
{
}
function policyIsAllowedToClaim(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(bool mayClaim)
{
}
// onlyProtectedWallet modifier
// sets policy to expired
// creates claim if allowed
// reverts if not allowed
function createDepegClaim(bytes32 processId)
external
onlyMatchingPolicy(processId)
onlyProtectedWallet(processId)
{
}
function policiesToProcess() public view returns(uint256 numberOfPolicies) {
}
function getPolicyToProcess(uint256 idx)
public
view
returns(
bytes32 processId,
address wallet
)
{
}
// convencience function for frontend, api, ...
function getClaimData(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(
address wallet,
uint256 protectedAmount,
uint256 actualAmount,
bool hasClaim,
uint256 claimId,
IPolicy.ClaimState claimState,
uint256 claimAmount,
uint256 claimCreatedAt
)
{
}
// convenience function to speed up processing
function processPolicies(bytes32 [] memory _processIds)
external
{
}
// claim confirmation and payout handling for a single policy
// payout will be made to policy holder (not to protected wallet)
// this is a current limitation of the gif framework
function processPolicy(bytes32 processId)
public
{
}
function getProtectedBalance(bytes32 processId) public view returns(uint256 protectedBalance) {
}
function encodeClaimInfoAsData(
uint256 depegPrice,
uint256 depeggedAt
)
public pure
returns (bytes memory data)
{
}
function decodeClaimInfoFromData(bytes memory data)
public pure
returns (
uint256 depegPrice,
uint256 depeggedAt
)
{
}
function calculateClaimAmount(uint256 tokenAmount)
public
view
returns(uint256 claimAmount)
{
}
// by circumventing prduct contract and directly updating usdc feed contract
function isNewPriceInfoEventAvailable()
external
view
returns(
bool newEvent,
IPriceDataProvider.PriceInfo memory priceInfo,
uint256 timeSinceEvent
)
{
}
function getDepegState() external view returns(DepegState state) {
}
function getLatestPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getDepegPriceInfo() external view returns(IPriceDataProvider.PriceInfo memory priceInfo) {
}
function getTriggeredAt() external view returns(uint256 triggeredAt) {
}
function getDepeggedAt() external view returns(uint256 depeggedAt) {
}
function getTargetPrice() external view returns(uint256 targetPrice) {
}
// manage depeg product state machine: active, paused, depegged
function processLatestPriceInfo()
external
returns(IPriceDataProvider.PriceInfo memory priceInfo)
{
}
function reactivateProduct()
external
onlyOwner()
{
}
function calculateNetPremium(uint256 sumInsured, uint256 duration, uint256 bundleId) public view returns(uint256 netPremium) {
}
// TODO make this (well: TreasuryModule._calculateFee actually) available via instance service
function calculateFee(uint256 amount)
public
view
returns(uint256 feeAmount, uint256 totalAmount)
{
}
// TODO make this available via instance service
function getFeeSpecification(uint256 componentId)
public
view
returns(ITreasury.FeeSpecification memory feeSpecification)
{
}
function getFeeFractionFullUnit()
public
view
returns(uint256 fractionFullUnit)
{
}
// TODO this functionality should be provided by GIF (TreasuryModule)
function calculatePremium(uint256 netPremium) public view returns(uint256 premiumAmount) {
}
function processIds(address policyHolder)
external
view
returns(uint256 numberOfProcessIds)
{
}
function getProcessId(address policyHolder, uint256 idx)
external
view
returns(bytes32 processId)
{
require(<FILL_ME>)
require(idx < _processIdsForHolder[policyHolder].length, "ERROR:DP-071:POLICY_INDEX_TOO_LARGE");
return _processIdsForHolder[policyHolder][idx];
}
function getProtectedWallet(bytes32 processId) public view returns(address wallet) {
}
function getPriceDataProvider() external view returns(address priceDataProvider) {
}
function getProtectedToken() external view returns(address protectedToken) {
}
function applications() external view returns(uint256 applicationCount) {
}
function getApplicationId(uint256 applicationIdx) external view returns(bytes32 processId) {
}
function policies() external view returns(uint256 policyCount) {
}
function getPolicyId(uint256 policyIdx) external view returns(bytes32 processId) {
}
function getApplicationDataStructure() external override pure returns(string memory dataStructure) {
}
}
| _processIdsForHolder[policyHolder].length>0,"ERROR:DP-070:NO_POLICIES" | 165,984 | _processIdsForHolder[policyHolder].length>0 |
"Stake: Token already staked" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./Poolable.sol";
import "./Recoverable.sol";
/** @title NftStakingPool
*/
contract NftStakingPool is Ownable, Poolable, Recoverable, ReentrancyGuard, ERC721Holder {
using SafeERC20 for IERC20;
struct PoolDeposit {
uint256 depositDate;
uint64 pool;
address owner;
}
IERC20 public rewardToken;
// poolDeposit per collection and tokenId
mapping(address => mapping(uint256 => PoolDeposit)) private _deposits;
// user rewards mapping
mapping(address => uint256) private _userRewards;
event Stake(address indexed account, uint256 poolId, address indexed collection, uint256 tokenId);
event Unstake(address indexed account, address indexed collection, uint256 tokenId);
event BatchStake(address indexed account, uint256 poolId, address indexed collection, uint256[] tokenIds);
event BatchUnstake(address indexed account, address indexed collection, uint256[] tokenIds);
constructor(IERC20 _rewardToken) {
}
function _sendRewards(address destination, uint256 amount) internal virtual {
}
function _sendAndUpdateRewards(address account, uint256 amount) internal {
}
function _stake(
address account,
address collection,
uint256 tokenId,
uint256 poolId
) internal {
require(<FILL_ME>)
// add deposit
_deposits[collection][tokenId] = PoolDeposit({
depositDate: block.timestamp,
pool: uint64(poolId),
owner: account
});
// transfer token
IERC721(collection).safeTransferFrom(account, address(this), tokenId);
}
/**
* @notice Stake a token from the collection
*/
function stake(uint256 poolId, uint256 tokenId) external nonReentrant whenPoolOpened(poolId) {
}
function _unstake(
address account,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Unstake a token
*/
function unstake(address collection, uint256 tokenId) external nonReentrant {
}
function _restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Allow a user to [re]stake a token in a new pool without unstaking it first.
*/
function restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) external nonReentrant {
}
function _batchStake(
address account,
uint256 poolId,
uint256[] memory tokenIds
) internal whenPoolOpened(poolId) {
}
function _batchUnstake(
address account,
address collection,
uint256[] memory tokenIds
) internal {
}
function _batchRestake(
address account,
uint256 poolId,
address collection,
uint256[] memory tokenIds
) internal {
}
/**
* @notice Batch stake a list of tokens from the collection
*/
function batchStake(uint256 poolId, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch unstake tokens
*/
function batchUnstake(address collection, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch restake tokens
*/
function batchRestake(
uint256 poolId,
address collection,
uint256[] calldata tokenIds
) external nonReentrant {
}
struct MultiStakeParam {
uint256[] tokenIds;
uint256 poolId;
}
/**
* @notice Batch stake a list of tokens from different collections
*/
function stakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch unstake tokens from different collections
*/
function unstakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch restake tokens from different collections
*/
function restakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Checks if a token has been deposited for enough time to get rewards
*/
function isTokenUnlocked(address collection, uint256 tokenId) public view returns (bool) {
}
/**
* @notice Get the stake detail for a token (owner, poolId, min unstakable date, reward unlock date)
*/
function getStakeInfo(address collection, uint256 tokenId)
external
view
returns (
address, // owner
uint256, // poolId
uint256, // deposit date
uint256, // unlock date
uint256 // reward date
)
{
}
/**
* @notice Returns the total reward for a user
*/
function getUserTotalRewards(address account) external view returns (uint256) {
}
function recoverNonFungibleToken(address _token, uint256 _tokenId) external override onlyOwner {
}
}
| _deposits[collection][tokenId].owner==address(0),"Stake: Token already staked" | 166,132 | _deposits[collection][tokenId].owner==address(0) |
"Stake: Not yet unstakable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./Poolable.sol";
import "./Recoverable.sol";
/** @title NftStakingPool
*/
contract NftStakingPool is Ownable, Poolable, Recoverable, ReentrancyGuard, ERC721Holder {
using SafeERC20 for IERC20;
struct PoolDeposit {
uint256 depositDate;
uint64 pool;
address owner;
}
IERC20 public rewardToken;
// poolDeposit per collection and tokenId
mapping(address => mapping(uint256 => PoolDeposit)) private _deposits;
// user rewards mapping
mapping(address => uint256) private _userRewards;
event Stake(address indexed account, uint256 poolId, address indexed collection, uint256 tokenId);
event Unstake(address indexed account, address indexed collection, uint256 tokenId);
event BatchStake(address indexed account, uint256 poolId, address indexed collection, uint256[] tokenIds);
event BatchUnstake(address indexed account, address indexed collection, uint256[] tokenIds);
constructor(IERC20 _rewardToken) {
}
function _sendRewards(address destination, uint256 amount) internal virtual {
}
function _sendAndUpdateRewards(address account, uint256 amount) internal {
}
function _stake(
address account,
address collection,
uint256 tokenId,
uint256 poolId
) internal {
}
/**
* @notice Stake a token from the collection
*/
function stake(uint256 poolId, uint256 tokenId) external nonReentrant whenPoolOpened(poolId) {
}
function _unstake(
address account,
address collection,
uint256 tokenId
) internal returns (uint256) {
uint256 poolId = _deposits[collection][tokenId].pool;
require(<FILL_ME>)
bool unlocked = isUnlocked(poolId, _deposits[collection][tokenId].depositDate);
// transfer token
IERC721(collection).safeTransferFrom(address(this), account, tokenId);
// update deposit
delete _deposits[collection][tokenId];
uint256 rewards = 0;
if (unlocked) {
Pool memory pool = getPool(poolId);
rewards = pool.rewardAmount;
}
return rewards;
}
/**
* @notice Unstake a token
*/
function unstake(address collection, uint256 tokenId) external nonReentrant {
}
function _restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Allow a user to [re]stake a token in a new pool without unstaking it first.
*/
function restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) external nonReentrant {
}
function _batchStake(
address account,
uint256 poolId,
uint256[] memory tokenIds
) internal whenPoolOpened(poolId) {
}
function _batchUnstake(
address account,
address collection,
uint256[] memory tokenIds
) internal {
}
function _batchRestake(
address account,
uint256 poolId,
address collection,
uint256[] memory tokenIds
) internal {
}
/**
* @notice Batch stake a list of tokens from the collection
*/
function batchStake(uint256 poolId, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch unstake tokens
*/
function batchUnstake(address collection, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch restake tokens
*/
function batchRestake(
uint256 poolId,
address collection,
uint256[] calldata tokenIds
) external nonReentrant {
}
struct MultiStakeParam {
uint256[] tokenIds;
uint256 poolId;
}
/**
* @notice Batch stake a list of tokens from different collections
*/
function stakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch unstake tokens from different collections
*/
function unstakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch restake tokens from different collections
*/
function restakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Checks if a token has been deposited for enough time to get rewards
*/
function isTokenUnlocked(address collection, uint256 tokenId) public view returns (bool) {
}
/**
* @notice Get the stake detail for a token (owner, poolId, min unstakable date, reward unlock date)
*/
function getStakeInfo(address collection, uint256 tokenId)
external
view
returns (
address, // owner
uint256, // poolId
uint256, // deposit date
uint256, // unlock date
uint256 // reward date
)
{
}
/**
* @notice Returns the total reward for a user
*/
function getUserTotalRewards(address account) external view returns (uint256) {
}
function recoverNonFungibleToken(address _token, uint256 _tokenId) external override onlyOwner {
}
}
| isUnlockable(poolId,_deposits[collection][tokenId].depositDate),"Stake: Not yet unstakable" | 166,132 | isUnlockable(poolId,_deposits[collection][tokenId].depositDate) |
"Stake: Not owner of token" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./Poolable.sol";
import "./Recoverable.sol";
/** @title NftStakingPool
*/
contract NftStakingPool is Ownable, Poolable, Recoverable, ReentrancyGuard, ERC721Holder {
using SafeERC20 for IERC20;
struct PoolDeposit {
uint256 depositDate;
uint64 pool;
address owner;
}
IERC20 public rewardToken;
// poolDeposit per collection and tokenId
mapping(address => mapping(uint256 => PoolDeposit)) private _deposits;
// user rewards mapping
mapping(address => uint256) private _userRewards;
event Stake(address indexed account, uint256 poolId, address indexed collection, uint256 tokenId);
event Unstake(address indexed account, address indexed collection, uint256 tokenId);
event BatchStake(address indexed account, uint256 poolId, address indexed collection, uint256[] tokenIds);
event BatchUnstake(address indexed account, address indexed collection, uint256[] tokenIds);
constructor(IERC20 _rewardToken) {
}
function _sendRewards(address destination, uint256 amount) internal virtual {
}
function _sendAndUpdateRewards(address account, uint256 amount) internal {
}
function _stake(
address account,
address collection,
uint256 tokenId,
uint256 poolId
) internal {
}
/**
* @notice Stake a token from the collection
*/
function stake(uint256 poolId, uint256 tokenId) external nonReentrant whenPoolOpened(poolId) {
}
function _unstake(
address account,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Unstake a token
*/
function unstake(address collection, uint256 tokenId) external nonReentrant {
require(<FILL_ME>)
address account = _msgSender();
uint256 rewards = _unstake(account, collection, tokenId);
_sendAndUpdateRewards(account, rewards);
emit Unstake(account, collection, tokenId);
}
function _restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Allow a user to [re]stake a token in a new pool without unstaking it first.
*/
function restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) external nonReentrant {
}
function _batchStake(
address account,
uint256 poolId,
uint256[] memory tokenIds
) internal whenPoolOpened(poolId) {
}
function _batchUnstake(
address account,
address collection,
uint256[] memory tokenIds
) internal {
}
function _batchRestake(
address account,
uint256 poolId,
address collection,
uint256[] memory tokenIds
) internal {
}
/**
* @notice Batch stake a list of tokens from the collection
*/
function batchStake(uint256 poolId, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch unstake tokens
*/
function batchUnstake(address collection, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch restake tokens
*/
function batchRestake(
uint256 poolId,
address collection,
uint256[] calldata tokenIds
) external nonReentrant {
}
struct MultiStakeParam {
uint256[] tokenIds;
uint256 poolId;
}
/**
* @notice Batch stake a list of tokens from different collections
*/
function stakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch unstake tokens from different collections
*/
function unstakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch restake tokens from different collections
*/
function restakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Checks if a token has been deposited for enough time to get rewards
*/
function isTokenUnlocked(address collection, uint256 tokenId) public view returns (bool) {
}
/**
* @notice Get the stake detail for a token (owner, poolId, min unstakable date, reward unlock date)
*/
function getStakeInfo(address collection, uint256 tokenId)
external
view
returns (
address, // owner
uint256, // poolId
uint256, // deposit date
uint256, // unlock date
uint256 // reward date
)
{
}
/**
* @notice Returns the total reward for a user
*/
function getUserTotalRewards(address account) external view returns (uint256) {
}
function recoverNonFungibleToken(address _token, uint256 _tokenId) external override onlyOwner {
}
}
| _deposits[collection][tokenId].owner==_msgSender(),"Stake: Not owner of token" | 166,132 | _deposits[collection][tokenId].owner==_msgSender() |
"Stake: Pool is closed" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./Poolable.sol";
import "./Recoverable.sol";
/** @title NftStakingPool
*/
contract NftStakingPool is Ownable, Poolable, Recoverable, ReentrancyGuard, ERC721Holder {
using SafeERC20 for IERC20;
struct PoolDeposit {
uint256 depositDate;
uint64 pool;
address owner;
}
IERC20 public rewardToken;
// poolDeposit per collection and tokenId
mapping(address => mapping(uint256 => PoolDeposit)) private _deposits;
// user rewards mapping
mapping(address => uint256) private _userRewards;
event Stake(address indexed account, uint256 poolId, address indexed collection, uint256 tokenId);
event Unstake(address indexed account, address indexed collection, uint256 tokenId);
event BatchStake(address indexed account, uint256 poolId, address indexed collection, uint256[] tokenIds);
event BatchUnstake(address indexed account, address indexed collection, uint256[] tokenIds);
constructor(IERC20 _rewardToken) {
}
function _sendRewards(address destination, uint256 amount) internal virtual {
}
function _sendAndUpdateRewards(address account, uint256 amount) internal {
}
function _stake(
address account,
address collection,
uint256 tokenId,
uint256 poolId
) internal {
}
/**
* @notice Stake a token from the collection
*/
function stake(uint256 poolId, uint256 tokenId) external nonReentrant whenPoolOpened(poolId) {
}
function _unstake(
address account,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Unstake a token
*/
function unstake(address collection, uint256 tokenId) external nonReentrant {
}
function _restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) internal returns (uint256) {
require(<FILL_ME>)
require(collectionForPool(newPoolId) == collection, "Stake: Invalid collection");
uint256 oldPoolId = _deposits[collection][tokenId].pool;
require(isUnlockable(oldPoolId, _deposits[collection][tokenId].depositDate), "Stake: Not yet unstakable");
bool unlocked = isUnlocked(oldPoolId, _deposits[collection][tokenId].depositDate);
// update deposit
_deposits[collection][tokenId].pool = uint64(newPoolId);
_deposits[collection][tokenId].depositDate = block.timestamp;
uint256 rewards = 0;
if (unlocked) {
Pool memory pool = getPool(oldPoolId);
rewards = pool.rewardAmount;
}
return rewards;
}
/**
* @notice Allow a user to [re]stake a token in a new pool without unstaking it first.
*/
function restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) external nonReentrant {
}
function _batchStake(
address account,
uint256 poolId,
uint256[] memory tokenIds
) internal whenPoolOpened(poolId) {
}
function _batchUnstake(
address account,
address collection,
uint256[] memory tokenIds
) internal {
}
function _batchRestake(
address account,
uint256 poolId,
address collection,
uint256[] memory tokenIds
) internal {
}
/**
* @notice Batch stake a list of tokens from the collection
*/
function batchStake(uint256 poolId, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch unstake tokens
*/
function batchUnstake(address collection, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch restake tokens
*/
function batchRestake(
uint256 poolId,
address collection,
uint256[] calldata tokenIds
) external nonReentrant {
}
struct MultiStakeParam {
uint256[] tokenIds;
uint256 poolId;
}
/**
* @notice Batch stake a list of tokens from different collections
*/
function stakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch unstake tokens from different collections
*/
function unstakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch restake tokens from different collections
*/
function restakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Checks if a token has been deposited for enough time to get rewards
*/
function isTokenUnlocked(address collection, uint256 tokenId) public view returns (bool) {
}
/**
* @notice Get the stake detail for a token (owner, poolId, min unstakable date, reward unlock date)
*/
function getStakeInfo(address collection, uint256 tokenId)
external
view
returns (
address, // owner
uint256, // poolId
uint256, // deposit date
uint256, // unlock date
uint256 // reward date
)
{
}
/**
* @notice Returns the total reward for a user
*/
function getUserTotalRewards(address account) external view returns (uint256) {
}
function recoverNonFungibleToken(address _token, uint256 _tokenId) external override onlyOwner {
}
}
| isPoolOpened(newPoolId),"Stake: Pool is closed" | 166,132 | isPoolOpened(newPoolId) |
"Stake: Invalid collection" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./Poolable.sol";
import "./Recoverable.sol";
/** @title NftStakingPool
*/
contract NftStakingPool is Ownable, Poolable, Recoverable, ReentrancyGuard, ERC721Holder {
using SafeERC20 for IERC20;
struct PoolDeposit {
uint256 depositDate;
uint64 pool;
address owner;
}
IERC20 public rewardToken;
// poolDeposit per collection and tokenId
mapping(address => mapping(uint256 => PoolDeposit)) private _deposits;
// user rewards mapping
mapping(address => uint256) private _userRewards;
event Stake(address indexed account, uint256 poolId, address indexed collection, uint256 tokenId);
event Unstake(address indexed account, address indexed collection, uint256 tokenId);
event BatchStake(address indexed account, uint256 poolId, address indexed collection, uint256[] tokenIds);
event BatchUnstake(address indexed account, address indexed collection, uint256[] tokenIds);
constructor(IERC20 _rewardToken) {
}
function _sendRewards(address destination, uint256 amount) internal virtual {
}
function _sendAndUpdateRewards(address account, uint256 amount) internal {
}
function _stake(
address account,
address collection,
uint256 tokenId,
uint256 poolId
) internal {
}
/**
* @notice Stake a token from the collection
*/
function stake(uint256 poolId, uint256 tokenId) external nonReentrant whenPoolOpened(poolId) {
}
function _unstake(
address account,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Unstake a token
*/
function unstake(address collection, uint256 tokenId) external nonReentrant {
}
function _restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) internal returns (uint256) {
require(isPoolOpened(newPoolId), "Stake: Pool is closed");
require(<FILL_ME>)
uint256 oldPoolId = _deposits[collection][tokenId].pool;
require(isUnlockable(oldPoolId, _deposits[collection][tokenId].depositDate), "Stake: Not yet unstakable");
bool unlocked = isUnlocked(oldPoolId, _deposits[collection][tokenId].depositDate);
// update deposit
_deposits[collection][tokenId].pool = uint64(newPoolId);
_deposits[collection][tokenId].depositDate = block.timestamp;
uint256 rewards = 0;
if (unlocked) {
Pool memory pool = getPool(oldPoolId);
rewards = pool.rewardAmount;
}
return rewards;
}
/**
* @notice Allow a user to [re]stake a token in a new pool without unstaking it first.
*/
function restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) external nonReentrant {
}
function _batchStake(
address account,
uint256 poolId,
uint256[] memory tokenIds
) internal whenPoolOpened(poolId) {
}
function _batchUnstake(
address account,
address collection,
uint256[] memory tokenIds
) internal {
}
function _batchRestake(
address account,
uint256 poolId,
address collection,
uint256[] memory tokenIds
) internal {
}
/**
* @notice Batch stake a list of tokens from the collection
*/
function batchStake(uint256 poolId, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch unstake tokens
*/
function batchUnstake(address collection, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch restake tokens
*/
function batchRestake(
uint256 poolId,
address collection,
uint256[] calldata tokenIds
) external nonReentrant {
}
struct MultiStakeParam {
uint256[] tokenIds;
uint256 poolId;
}
/**
* @notice Batch stake a list of tokens from different collections
*/
function stakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch unstake tokens from different collections
*/
function unstakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch restake tokens from different collections
*/
function restakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Checks if a token has been deposited for enough time to get rewards
*/
function isTokenUnlocked(address collection, uint256 tokenId) public view returns (bool) {
}
/**
* @notice Get the stake detail for a token (owner, poolId, min unstakable date, reward unlock date)
*/
function getStakeInfo(address collection, uint256 tokenId)
external
view
returns (
address, // owner
uint256, // poolId
uint256, // deposit date
uint256, // unlock date
uint256 // reward date
)
{
}
/**
* @notice Returns the total reward for a user
*/
function getUserTotalRewards(address account) external view returns (uint256) {
}
function recoverNonFungibleToken(address _token, uint256 _tokenId) external override onlyOwner {
}
}
| collectionForPool(newPoolId)==collection,"Stake: Invalid collection" | 166,132 | collectionForPool(newPoolId)==collection |
"Stake: Not yet unstakable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./Poolable.sol";
import "./Recoverable.sol";
/** @title NftStakingPool
*/
contract NftStakingPool is Ownable, Poolable, Recoverable, ReentrancyGuard, ERC721Holder {
using SafeERC20 for IERC20;
struct PoolDeposit {
uint256 depositDate;
uint64 pool;
address owner;
}
IERC20 public rewardToken;
// poolDeposit per collection and tokenId
mapping(address => mapping(uint256 => PoolDeposit)) private _deposits;
// user rewards mapping
mapping(address => uint256) private _userRewards;
event Stake(address indexed account, uint256 poolId, address indexed collection, uint256 tokenId);
event Unstake(address indexed account, address indexed collection, uint256 tokenId);
event BatchStake(address indexed account, uint256 poolId, address indexed collection, uint256[] tokenIds);
event BatchUnstake(address indexed account, address indexed collection, uint256[] tokenIds);
constructor(IERC20 _rewardToken) {
}
function _sendRewards(address destination, uint256 amount) internal virtual {
}
function _sendAndUpdateRewards(address account, uint256 amount) internal {
}
function _stake(
address account,
address collection,
uint256 tokenId,
uint256 poolId
) internal {
}
/**
* @notice Stake a token from the collection
*/
function stake(uint256 poolId, uint256 tokenId) external nonReentrant whenPoolOpened(poolId) {
}
function _unstake(
address account,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Unstake a token
*/
function unstake(address collection, uint256 tokenId) external nonReentrant {
}
function _restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) internal returns (uint256) {
require(isPoolOpened(newPoolId), "Stake: Pool is closed");
require(collectionForPool(newPoolId) == collection, "Stake: Invalid collection");
uint256 oldPoolId = _deposits[collection][tokenId].pool;
require(<FILL_ME>)
bool unlocked = isUnlocked(oldPoolId, _deposits[collection][tokenId].depositDate);
// update deposit
_deposits[collection][tokenId].pool = uint64(newPoolId);
_deposits[collection][tokenId].depositDate = block.timestamp;
uint256 rewards = 0;
if (unlocked) {
Pool memory pool = getPool(oldPoolId);
rewards = pool.rewardAmount;
}
return rewards;
}
/**
* @notice Allow a user to [re]stake a token in a new pool without unstaking it first.
*/
function restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) external nonReentrant {
}
function _batchStake(
address account,
uint256 poolId,
uint256[] memory tokenIds
) internal whenPoolOpened(poolId) {
}
function _batchUnstake(
address account,
address collection,
uint256[] memory tokenIds
) internal {
}
function _batchRestake(
address account,
uint256 poolId,
address collection,
uint256[] memory tokenIds
) internal {
}
/**
* @notice Batch stake a list of tokens from the collection
*/
function batchStake(uint256 poolId, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch unstake tokens
*/
function batchUnstake(address collection, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch restake tokens
*/
function batchRestake(
uint256 poolId,
address collection,
uint256[] calldata tokenIds
) external nonReentrant {
}
struct MultiStakeParam {
uint256[] tokenIds;
uint256 poolId;
}
/**
* @notice Batch stake a list of tokens from different collections
*/
function stakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch unstake tokens from different collections
*/
function unstakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch restake tokens from different collections
*/
function restakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Checks if a token has been deposited for enough time to get rewards
*/
function isTokenUnlocked(address collection, uint256 tokenId) public view returns (bool) {
}
/**
* @notice Get the stake detail for a token (owner, poolId, min unstakable date, reward unlock date)
*/
function getStakeInfo(address collection, uint256 tokenId)
external
view
returns (
address, // owner
uint256, // poolId
uint256, // deposit date
uint256, // unlock date
uint256 // reward date
)
{
}
/**
* @notice Returns the total reward for a user
*/
function getUserTotalRewards(address account) external view returns (uint256) {
}
function recoverNonFungibleToken(address _token, uint256 _tokenId) external override onlyOwner {
}
}
| isUnlockable(oldPoolId,_deposits[collection][tokenId].depositDate),"Stake: Not yet unstakable" | 166,132 | isUnlockable(oldPoolId,_deposits[collection][tokenId].depositDate) |
"Stake: Token not staked" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./Poolable.sol";
import "./Recoverable.sol";
/** @title NftStakingPool
*/
contract NftStakingPool is Ownable, Poolable, Recoverable, ReentrancyGuard, ERC721Holder {
using SafeERC20 for IERC20;
struct PoolDeposit {
uint256 depositDate;
uint64 pool;
address owner;
}
IERC20 public rewardToken;
// poolDeposit per collection and tokenId
mapping(address => mapping(uint256 => PoolDeposit)) private _deposits;
// user rewards mapping
mapping(address => uint256) private _userRewards;
event Stake(address indexed account, uint256 poolId, address indexed collection, uint256 tokenId);
event Unstake(address indexed account, address indexed collection, uint256 tokenId);
event BatchStake(address indexed account, uint256 poolId, address indexed collection, uint256[] tokenIds);
event BatchUnstake(address indexed account, address indexed collection, uint256[] tokenIds);
constructor(IERC20 _rewardToken) {
}
function _sendRewards(address destination, uint256 amount) internal virtual {
}
function _sendAndUpdateRewards(address account, uint256 amount) internal {
}
function _stake(
address account,
address collection,
uint256 tokenId,
uint256 poolId
) internal {
}
/**
* @notice Stake a token from the collection
*/
function stake(uint256 poolId, uint256 tokenId) external nonReentrant whenPoolOpened(poolId) {
}
function _unstake(
address account,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Unstake a token
*/
function unstake(address collection, uint256 tokenId) external nonReentrant {
}
function _restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Allow a user to [re]stake a token in a new pool without unstaking it first.
*/
function restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) external nonReentrant {
require(<FILL_ME>)
require(_deposits[collection][tokenId].owner == _msgSender(), "Stake: Not owner of token");
address account = _msgSender();
uint256 rewards = _restake(newPoolId, collection, tokenId);
_sendAndUpdateRewards(account, rewards);
emit Unstake(account, collection, tokenId);
emit Stake(account, newPoolId, collection, tokenId);
}
function _batchStake(
address account,
uint256 poolId,
uint256[] memory tokenIds
) internal whenPoolOpened(poolId) {
}
function _batchUnstake(
address account,
address collection,
uint256[] memory tokenIds
) internal {
}
function _batchRestake(
address account,
uint256 poolId,
address collection,
uint256[] memory tokenIds
) internal {
}
/**
* @notice Batch stake a list of tokens from the collection
*/
function batchStake(uint256 poolId, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch unstake tokens
*/
function batchUnstake(address collection, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch restake tokens
*/
function batchRestake(
uint256 poolId,
address collection,
uint256[] calldata tokenIds
) external nonReentrant {
}
struct MultiStakeParam {
uint256[] tokenIds;
uint256 poolId;
}
/**
* @notice Batch stake a list of tokens from different collections
*/
function stakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch unstake tokens from different collections
*/
function unstakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch restake tokens from different collections
*/
function restakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Checks if a token has been deposited for enough time to get rewards
*/
function isTokenUnlocked(address collection, uint256 tokenId) public view returns (bool) {
}
/**
* @notice Get the stake detail for a token (owner, poolId, min unstakable date, reward unlock date)
*/
function getStakeInfo(address collection, uint256 tokenId)
external
view
returns (
address, // owner
uint256, // poolId
uint256, // deposit date
uint256, // unlock date
uint256 // reward date
)
{
}
/**
* @notice Returns the total reward for a user
*/
function getUserTotalRewards(address account) external view returns (uint256) {
}
function recoverNonFungibleToken(address _token, uint256 _tokenId) external override onlyOwner {
}
}
| _deposits[collection][tokenId].owner!=address(0),"Stake: Token not staked" | 166,132 | _deposits[collection][tokenId].owner!=address(0) |
"Stake: Not owner of token" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./Poolable.sol";
import "./Recoverable.sol";
/** @title NftStakingPool
*/
contract NftStakingPool is Ownable, Poolable, Recoverable, ReentrancyGuard, ERC721Holder {
using SafeERC20 for IERC20;
struct PoolDeposit {
uint256 depositDate;
uint64 pool;
address owner;
}
IERC20 public rewardToken;
// poolDeposit per collection and tokenId
mapping(address => mapping(uint256 => PoolDeposit)) private _deposits;
// user rewards mapping
mapping(address => uint256) private _userRewards;
event Stake(address indexed account, uint256 poolId, address indexed collection, uint256 tokenId);
event Unstake(address indexed account, address indexed collection, uint256 tokenId);
event BatchStake(address indexed account, uint256 poolId, address indexed collection, uint256[] tokenIds);
event BatchUnstake(address indexed account, address indexed collection, uint256[] tokenIds);
constructor(IERC20 _rewardToken) {
}
function _sendRewards(address destination, uint256 amount) internal virtual {
}
function _sendAndUpdateRewards(address account, uint256 amount) internal {
}
function _stake(
address account,
address collection,
uint256 tokenId,
uint256 poolId
) internal {
}
/**
* @notice Stake a token from the collection
*/
function stake(uint256 poolId, uint256 tokenId) external nonReentrant whenPoolOpened(poolId) {
}
function _unstake(
address account,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Unstake a token
*/
function unstake(address collection, uint256 tokenId) external nonReentrant {
}
function _restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Allow a user to [re]stake a token in a new pool without unstaking it first.
*/
function restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) external nonReentrant {
}
function _batchStake(
address account,
uint256 poolId,
uint256[] memory tokenIds
) internal whenPoolOpened(poolId) {
}
function _batchUnstake(
address account,
address collection,
uint256[] memory tokenIds
) internal {
uint256 rewards = 0;
for (uint256 i = 0; i < tokenIds.length; i++) {
require(<FILL_ME>)
rewards = rewards + _unstake(account, collection, tokenIds[i]);
}
_sendAndUpdateRewards(account, rewards);
emit BatchUnstake(account, collection, tokenIds);
}
function _batchRestake(
address account,
uint256 poolId,
address collection,
uint256[] memory tokenIds
) internal {
}
/**
* @notice Batch stake a list of tokens from the collection
*/
function batchStake(uint256 poolId, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch unstake tokens
*/
function batchUnstake(address collection, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch restake tokens
*/
function batchRestake(
uint256 poolId,
address collection,
uint256[] calldata tokenIds
) external nonReentrant {
}
struct MultiStakeParam {
uint256[] tokenIds;
uint256 poolId;
}
/**
* @notice Batch stake a list of tokens from different collections
*/
function stakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch unstake tokens from different collections
*/
function unstakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch restake tokens from different collections
*/
function restakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Checks if a token has been deposited for enough time to get rewards
*/
function isTokenUnlocked(address collection, uint256 tokenId) public view returns (bool) {
}
/**
* @notice Get the stake detail for a token (owner, poolId, min unstakable date, reward unlock date)
*/
function getStakeInfo(address collection, uint256 tokenId)
external
view
returns (
address, // owner
uint256, // poolId
uint256, // deposit date
uint256, // unlock date
uint256 // reward date
)
{
}
/**
* @notice Returns the total reward for a user
*/
function getUserTotalRewards(address account) external view returns (uint256) {
}
function recoverNonFungibleToken(address _token, uint256 _tokenId) external override onlyOwner {
}
}
| _deposits[collection][tokenIds[i]].owner==account,"Stake: Not owner of token" | 166,132 | _deposits[collection][tokenIds[i]].owner==account |
"Stake: Cannot recover staked token" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./Poolable.sol";
import "./Recoverable.sol";
/** @title NftStakingPool
*/
contract NftStakingPool is Ownable, Poolable, Recoverable, ReentrancyGuard, ERC721Holder {
using SafeERC20 for IERC20;
struct PoolDeposit {
uint256 depositDate;
uint64 pool;
address owner;
}
IERC20 public rewardToken;
// poolDeposit per collection and tokenId
mapping(address => mapping(uint256 => PoolDeposit)) private _deposits;
// user rewards mapping
mapping(address => uint256) private _userRewards;
event Stake(address indexed account, uint256 poolId, address indexed collection, uint256 tokenId);
event Unstake(address indexed account, address indexed collection, uint256 tokenId);
event BatchStake(address indexed account, uint256 poolId, address indexed collection, uint256[] tokenIds);
event BatchUnstake(address indexed account, address indexed collection, uint256[] tokenIds);
constructor(IERC20 _rewardToken) {
}
function _sendRewards(address destination, uint256 amount) internal virtual {
}
function _sendAndUpdateRewards(address account, uint256 amount) internal {
}
function _stake(
address account,
address collection,
uint256 tokenId,
uint256 poolId
) internal {
}
/**
* @notice Stake a token from the collection
*/
function stake(uint256 poolId, uint256 tokenId) external nonReentrant whenPoolOpened(poolId) {
}
function _unstake(
address account,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Unstake a token
*/
function unstake(address collection, uint256 tokenId) external nonReentrant {
}
function _restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) internal returns (uint256) {
}
/**
* @notice Allow a user to [re]stake a token in a new pool without unstaking it first.
*/
function restake(
uint256 newPoolId,
address collection,
uint256 tokenId
) external nonReentrant {
}
function _batchStake(
address account,
uint256 poolId,
uint256[] memory tokenIds
) internal whenPoolOpened(poolId) {
}
function _batchUnstake(
address account,
address collection,
uint256[] memory tokenIds
) internal {
}
function _batchRestake(
address account,
uint256 poolId,
address collection,
uint256[] memory tokenIds
) internal {
}
/**
* @notice Batch stake a list of tokens from the collection
*/
function batchStake(uint256 poolId, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch unstake tokens
*/
function batchUnstake(address collection, uint256[] calldata tokenIds) external nonReentrant {
}
/**
* @notice Batch restake tokens
*/
function batchRestake(
uint256 poolId,
address collection,
uint256[] calldata tokenIds
) external nonReentrant {
}
struct MultiStakeParam {
uint256[] tokenIds;
uint256 poolId;
}
/**
* @notice Batch stake a list of tokens from different collections
*/
function stakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch unstake tokens from different collections
*/
function unstakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Batch restake tokens from different collections
*/
function restakeMulti(MultiStakeParam[] memory groups) external nonReentrant {
}
/**
* @notice Checks if a token has been deposited for enough time to get rewards
*/
function isTokenUnlocked(address collection, uint256 tokenId) public view returns (bool) {
}
/**
* @notice Get the stake detail for a token (owner, poolId, min unstakable date, reward unlock date)
*/
function getStakeInfo(address collection, uint256 tokenId)
external
view
returns (
address, // owner
uint256, // poolId
uint256, // deposit date
uint256, // unlock date
uint256 // reward date
)
{
}
/**
* @notice Returns the total reward for a user
*/
function getUserTotalRewards(address account) external view returns (uint256) {
}
function recoverNonFungibleToken(address _token, uint256 _tokenId) external override onlyOwner {
// staked tokens cannot be recovered by owner
require(<FILL_ME>)
IERC721(_token).transferFrom(address(this), address(msg.sender), _tokenId);
emit NonFungibleTokenRecovery(_token, _tokenId);
}
}
| _deposits[_token][_tokenId].owner==address(0),"Stake: Cannot recover staked token" | 166,132 | _deposits[_token][_tokenId].owner==address(0) |
null | // SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.20;
import "@uniswap/v3-periphery/contracts/libraries/LiquidityAmounts.sol";
import "@uniswap/v3-core/contracts/libraries/TickMath.sol";
import "../../HarvestableApyFlowVault.sol";
import "../../libraries/Utils.sol";
import "../../libraries/SafeAssetConverter.sol";
import "../../libraries/PricesLibrary.sol";
import "../../ChainlinkPriceFeedAggregator.sol";
import "../../libraries/ConcentratedLiquidityLibrary.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
abstract contract BaseConcentratedLiquidityStrategy is HarvestableApyFlowVault {
using SafeERC20 for IERC20;
using SafeAssetConverter for IAssetConverter;
using PricesLibrary for ChainlinkPriceFeedAggregator;
error PoolPriceDeviationTooHigh(int24 oracleTick, int24 poolTick, uint24 diff, uint24 allowed);
struct PositionData {
int24 tickLower;
int24 tickUpper;
uint128 liquidity;
}
uint256 public lastPricePerToken;
event LiquidityReadded(uint256 lastPricePerToken, uint256 pricePerTokensBefore, uint256 pricePerTokenAfter);
ChainlinkPriceFeedAggregator public immutable pricesOracle;
IAssetConverter public immutable assetConverter;
int24 public immutable ticksDown;
int24 public immutable ticksUp;
uint24 public immutable allowedPoolOracleDeviation;
bool public immutable readdOnProfit;
constructor(
int24 _ticksDown,
int24 _ticksUp,
uint24 _allowedPoolOracleDeviation,
bool _readdOnProfit,
ChainlinkPriceFeedAggregator _pricesOracle,
IAssetConverter _assetConverter
) {
}
function token0() public view virtual returns (address);
function token1() public view virtual returns (address);
function _isPositionExists() internal view virtual returns (bool);
function _increaseLiquidity(uint256 amount0, uint256 amount1) internal virtual;
function _decreaseLiquidity(uint128 liquidity) internal virtual returns (uint256 amount0, uint256 amount1);
function _mint(int24 tickLower, int24 tickUpper, uint256 amount0, uint256 amount1) internal virtual;
function getPoolData() public view virtual returns (int24 currentTick, uint160 sqrtPriceX96);
function getPositionData() public view virtual returns (PositionData memory data);
function _collectAllAndBurn() internal virtual;
function _collect() internal virtual;
function _tickSpacing() internal view virtual returns (int24);
function _checkDeviation() internal {
}
modifier checkDeviation() {
}
function _performApprovals() internal virtual {
}
function _getTicks() internal view returns (int24 tickLower, int24 tickUpper) {
}
function _getSqrtPrices()
internal
view
returns (uint160 sqrtPriceAX96, uint160 sqrtPriceX96, uint160 sqrtPriceBX96)
{
}
function _mintNewPosition(uint256 amount0, uint256 amount1) internal virtual {
}
function _increaseLiquidityOrMintPosition(uint256 amount0, uint256 amount1) internal {
}
function _totalAssets() internal view virtual override returns (uint256 assets) {
}
function _getAmounts(uint256 assets) internal view returns (uint256 amountFor0, uint256 amountFor1) {
}
function _deposit(uint256 assets) internal virtual override checkDeviation {
}
function _redeem(uint256 shares) internal virtual override checkDeviation returns (uint256 assets) {
}
function _readdLiquidity() internal virtual {
}
function _harvest() internal virtual override {
}
function getPoolStateFromOracle() public view returns (int24 tick, uint160 sqrtPriceX96) {
}
function _isInRange(uint160 sqrtPriceAX96, uint160 sqrtPriceX96, uint160 sqrtPriceBX96)
private
pure
returns (bool)
{
}
function readdLiquidity() public virtual {
bool calledByOwner = msg.sender == owner();
if (!calledByOwner) {
_checkDeviation();
}
_harvest(false);
(, uint160 oracleSqrtPriceX96) = getPoolStateFromOracle();
(, uint160 poolSqrtPriceX96) = getPoolData();
PositionData memory data = getPositionData();
uint160 sqrtPriceLowerX96 = TickMath.getSqrtRatioAtTick(data.tickLower);
uint160 sqrtPriceUpperX96 = TickMath.getSqrtRatioAtTick(data.tickUpper);
bool isInRebalanceRange = !_isInRange(sqrtPriceLowerX96, poolSqrtPriceX96, sqrtPriceUpperX96)
&& !_isInRange(sqrtPriceLowerX96, oracleSqrtPriceX96, sqrtPriceUpperX96);
uint256 pricePerTokenBefore = pricePerToken();
_readdLiquidity();
uint256 pricePerTokenAfter = pricePerToken();
if (!calledByOwner) {
require(<FILL_ME>)
}
emit LiquidityReadded(lastPricePerToken, pricePerTokenBefore, pricePerTokenAfter);
lastPricePerToken = pricePerTokenAfter;
}
}
| isInRebalanceRange||(readdOnProfit&&(pricePerTokenAfter>=(lastPricePerToken*1001)/1000)) | 166,176 | isInRebalanceRange||(readdOnProfit&&(pricePerTokenAfter>=(lastPricePerToken*1001)/1000)) |
"Max supply is 6666" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract FatalAirdrop is ERC721A, Ownable {
constructor(string memory name, string memory symbol) ERC721A(name, symbol) {
}
uint256 maxSupply = 6666;
function airdrop(address[] memory addr) external onlyOwner {
require(<FILL_ME>)
uint256 count;
while (count < addr.length) {
_mint(addr[count], 1);
count = SafeMath.add(count, 1);
}
}
string public baseTokenURI;
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory uri) public onlyOwner {
}
bool public open;
function setOpen() public onlyOwner {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
function _opposite(bool state) internal pure returns (bool) {
}
}
| addr.length+totalSupply()<=maxSupply,"Max supply is 6666" | 166,223 | addr.length+totalSupply()<=maxSupply |
"You have minted the max free amount allowed per wallet." | pragma solidity ^0.8.4;
contract NOBODYS is ERC721A, Ownable {
using Strings for uint256;
string public baseURI = "https://nobodys.s3.amazonaws.com/metadata/";
uint256 public price = 0.001 ether;
uint256 public maxPerTx = 10;
uint256 public maxSupply = 10000;
uint256 public maxFreePerWallet = 1;
uint256 public totalFreeMinted = 0;
uint256 public maxFreeSupply = 5000;
mapping(address => uint256) public _mintedFreeAmount;
constructor() ERC721A("NOBODYS Official", "NOBODYS") {}
function mint(uint256 _amount) external payable {
}
function mintFree(uint256 _amount) external payable {
require(<FILL_ME>)
require(totalFreeMinted + _amount <= maxFreeSupply, "Cannot exceed Free supply." );
require(totalSupply() + _amount <= maxSupply, "Sold out.");
_mintedFreeAmount[msg.sender]++;
totalFreeMinted++;
_safeMint(msg.sender, _amount);
}
function teamMint(uint256 _amount, address _wallet) external onlyOwner {
}
function tokenURI(uint256 tokenId)
public view virtual override returns (string memory) {
}
function setBaseURI(string calldata baseURI_) external onlyOwner {
}
function setPrice(uint256 _price) external onlyOwner {
}
function setMaxPerTx(uint256 _amount) external onlyOwner {
}
function reduceSupply(uint256 _newSupply) external onlyOwner {
}
function setmaxFreeSupply(uint256 _newMaxFreeSupply) public onlyOwner {
}
function _startTokenId() internal pure override returns (uint256) {
}
function withdraw() external onlyOwner {
}
}
| _mintedFreeAmount[msg.sender]+_amount<=maxFreePerWallet,"You have minted the max free amount allowed per wallet." | 166,277 | _mintedFreeAmount[msg.sender]+_amount<=maxFreePerWallet |
"Cannot exceed Free supply." | pragma solidity ^0.8.4;
contract NOBODYS is ERC721A, Ownable {
using Strings for uint256;
string public baseURI = "https://nobodys.s3.amazonaws.com/metadata/";
uint256 public price = 0.001 ether;
uint256 public maxPerTx = 10;
uint256 public maxSupply = 10000;
uint256 public maxFreePerWallet = 1;
uint256 public totalFreeMinted = 0;
uint256 public maxFreeSupply = 5000;
mapping(address => uint256) public _mintedFreeAmount;
constructor() ERC721A("NOBODYS Official", "NOBODYS") {}
function mint(uint256 _amount) external payable {
}
function mintFree(uint256 _amount) external payable {
require(_mintedFreeAmount[msg.sender] + _amount <= maxFreePerWallet, "You have minted the max free amount allowed per wallet.");
require(<FILL_ME>)
require(totalSupply() + _amount <= maxSupply, "Sold out.");
_mintedFreeAmount[msg.sender]++;
totalFreeMinted++;
_safeMint(msg.sender, _amount);
}
function teamMint(uint256 _amount, address _wallet) external onlyOwner {
}
function tokenURI(uint256 tokenId)
public view virtual override returns (string memory) {
}
function setBaseURI(string calldata baseURI_) external onlyOwner {
}
function setPrice(uint256 _price) external onlyOwner {
}
function setMaxPerTx(uint256 _amount) external onlyOwner {
}
function reduceSupply(uint256 _newSupply) external onlyOwner {
}
function setmaxFreeSupply(uint256 _newMaxFreeSupply) public onlyOwner {
}
function _startTokenId() internal pure override returns (uint256) {
}
function withdraw() external onlyOwner {
}
}
| totalFreeMinted+_amount<=maxFreeSupply,"Cannot exceed Free supply." | 166,277 | totalFreeMinted+_amount<=maxFreeSupply |
Errors.CALLER_NOT_POOL_ADMIN | // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
import {
InitializableImmutableAdminUpgradeabilityProxy
} from '../libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol';
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol';
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
import {ILendingPool} from '../../interfaces/ILendingPool.sol';
import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol';
import {Errors} from '../libraries/helpers/Errors.sol';
import {PercentageMath} from '../libraries/math/PercentageMath.sol';
import {DataTypes} from '../libraries/types/DataTypes.sol';
import {IInitializableDebtToken} from '../../interfaces/IInitializableDebtToken.sol';
import {IInitializableAToken} from '../../interfaces/IInitializableAToken.sol';
import {IChefIncentivesController} from '../../interfaces/IChefIncentivesController.sol';
import {ILendingPoolConfigurator} from '../../interfaces/ILendingPoolConfigurator.sol';
import {IMultiFeeDistribution} from '../../interfaces/IMultiFeeDistribution.sol';
/**
* @title LendingPoolConfigurator contract
* @author Aave
* @dev Implements the configuration methods for the Aave protocol
**/
contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigurator {
using SafeMath for uint256;
using PercentageMath for uint256;
using ReserveConfiguration for DataTypes.ReserveConfigurationMap;
ILendingPoolAddressesProvider internal addressesProvider;
ILendingPool internal pool;
modifier onlyPoolAdmin {
require(<FILL_ME>)
_;
}
modifier onlyEmergencyAdmin {
}
uint256 internal constant CONFIGURATOR_REVISION = 0x1;
function getRevision() internal pure override returns (uint256) {
}
function initialize(ILendingPoolAddressesProvider provider) public initializer {
}
/**
* @dev Initializes reserves in batch
**/
function batchInitReserve(InitReserveInput[] calldata input) external onlyPoolAdmin {
}
function _initReserve(ILendingPool pool, InitReserveInput calldata input) internal {
}
/**
* @dev Updates the aToken implementation for the reserve
**/
function updateAToken(UpdateATokenInput calldata input) external onlyPoolAdmin {
}
/**
* @dev Updates the stable debt token implementation for the reserve
**/
function updateStableDebtToken(UpdateDebtTokenInput calldata input) external onlyPoolAdmin {
}
/**
* @dev Updates the variable debt token implementation for the asset
**/
function updateVariableDebtToken(UpdateDebtTokenInput calldata input) external onlyPoolAdmin {
}
/**
* @dev Enables borrowing on a reserve
* @param asset The address of the underlying asset of the reserve
* @param stableBorrowRateEnabled True if stable borrow rate needs to be enabled by default on this reserve
**/
function enableBorrowingOnReserve(address asset, bool stableBorrowRateEnabled)
external
onlyPoolAdmin
{
}
/**
* @dev Disables borrowing on a reserve
* @param asset The address of the underlying asset of the reserve
**/
function disableBorrowingOnReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Configures the reserve collateralization parameters
* all the values are expressed in percentages with two decimals of precision. A valid value is 10000, which means 100.00%
* @param asset The address of the underlying asset of the reserve
* @param ltv The loan to value of the asset when used as collateral
* @param liquidationThreshold The threshold at which loans using this asset as collateral will be considered undercollateralized
* @param liquidationBonus The bonus liquidators receive to liquidate this asset. The values is always above 100%. A value of 105%
* means the liquidator will receive a 5% bonus
**/
function configureReserveAsCollateral(
address asset,
uint256 ltv,
uint256 liquidationThreshold,
uint256 liquidationBonus
) external onlyPoolAdmin {
}
/**
* @dev Enable stable rate borrowing on a reserve
* @param asset The address of the underlying asset of the reserve
**/
function enableReserveStableRate(address asset) external onlyPoolAdmin {
}
/**
* @dev Disable stable rate borrowing on a reserve
* @param asset The address of the underlying asset of the reserve
**/
function disableReserveStableRate(address asset) external onlyPoolAdmin {
}
/**
* @dev Activates a reserve
* @param asset The address of the underlying asset of the reserve
**/
function activateReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Deactivates a reserve
* @param asset The address of the underlying asset of the reserve
**/
function deactivateReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Freezes a reserve. A frozen reserve doesn't allow any new deposit, borrow or rate swap
* but allows repayments, liquidations, rate rebalances and withdrawals
* @param asset The address of the underlying asset of the reserve
**/
function freezeReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Unfreezes a reserve
* @param asset The address of the underlying asset of the reserve
**/
function unfreezeReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Updates the reserve factor of a reserve
* @param asset The address of the underlying asset of the reserve
* @param reserveFactor The new reserve factor of the reserve
**/
function setReserveFactor(address asset, uint256 reserveFactor) external onlyPoolAdmin {
}
/**
* @dev Sets the interest rate strategy of a reserve
* @param asset The address of the underlying asset of the reserve
* @param rateStrategyAddress The new address of the interest strategy contract
**/
function setReserveInterestRateStrategyAddress(address asset, address rateStrategyAddress)
external
onlyPoolAdmin
{
}
/**
* @dev pauses or unpauses all the actions of the protocol, including aToken transfers
* @param val true if protocol needs to be paused, false otherwise
**/
function setPoolPause(bool val) external onlyEmergencyAdmin {
}
function _initTokenWithProxy(address implementation, bytes memory initParams)
internal
returns (address)
{
}
function _upgradeTokenImplementation(
address proxyAddress,
address implementation,
bytes memory initParams
) internal {
}
function _checkNoLiquidity(address asset) internal view {
}
}
| addressesProvider.getPoolAdmin()==msg.sender,Errors.CALLER_NOT_POOL_ADMIN | 166,514 | addressesProvider.getPoolAdmin()==msg.sender |
Errors.LPC_CALLER_NOT_EMERGENCY_ADMIN | // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
import {
InitializableImmutableAdminUpgradeabilityProxy
} from '../libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol';
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol';
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
import {ILendingPool} from '../../interfaces/ILendingPool.sol';
import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol';
import {Errors} from '../libraries/helpers/Errors.sol';
import {PercentageMath} from '../libraries/math/PercentageMath.sol';
import {DataTypes} from '../libraries/types/DataTypes.sol';
import {IInitializableDebtToken} from '../../interfaces/IInitializableDebtToken.sol';
import {IInitializableAToken} from '../../interfaces/IInitializableAToken.sol';
import {IChefIncentivesController} from '../../interfaces/IChefIncentivesController.sol';
import {ILendingPoolConfigurator} from '../../interfaces/ILendingPoolConfigurator.sol';
import {IMultiFeeDistribution} from '../../interfaces/IMultiFeeDistribution.sol';
/**
* @title LendingPoolConfigurator contract
* @author Aave
* @dev Implements the configuration methods for the Aave protocol
**/
contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigurator {
using SafeMath for uint256;
using PercentageMath for uint256;
using ReserveConfiguration for DataTypes.ReserveConfigurationMap;
ILendingPoolAddressesProvider internal addressesProvider;
ILendingPool internal pool;
modifier onlyPoolAdmin {
}
modifier onlyEmergencyAdmin {
require(<FILL_ME>)
_;
}
uint256 internal constant CONFIGURATOR_REVISION = 0x1;
function getRevision() internal pure override returns (uint256) {
}
function initialize(ILendingPoolAddressesProvider provider) public initializer {
}
/**
* @dev Initializes reserves in batch
**/
function batchInitReserve(InitReserveInput[] calldata input) external onlyPoolAdmin {
}
function _initReserve(ILendingPool pool, InitReserveInput calldata input) internal {
}
/**
* @dev Updates the aToken implementation for the reserve
**/
function updateAToken(UpdateATokenInput calldata input) external onlyPoolAdmin {
}
/**
* @dev Updates the stable debt token implementation for the reserve
**/
function updateStableDebtToken(UpdateDebtTokenInput calldata input) external onlyPoolAdmin {
}
/**
* @dev Updates the variable debt token implementation for the asset
**/
function updateVariableDebtToken(UpdateDebtTokenInput calldata input) external onlyPoolAdmin {
}
/**
* @dev Enables borrowing on a reserve
* @param asset The address of the underlying asset of the reserve
* @param stableBorrowRateEnabled True if stable borrow rate needs to be enabled by default on this reserve
**/
function enableBorrowingOnReserve(address asset, bool stableBorrowRateEnabled)
external
onlyPoolAdmin
{
}
/**
* @dev Disables borrowing on a reserve
* @param asset The address of the underlying asset of the reserve
**/
function disableBorrowingOnReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Configures the reserve collateralization parameters
* all the values are expressed in percentages with two decimals of precision. A valid value is 10000, which means 100.00%
* @param asset The address of the underlying asset of the reserve
* @param ltv The loan to value of the asset when used as collateral
* @param liquidationThreshold The threshold at which loans using this asset as collateral will be considered undercollateralized
* @param liquidationBonus The bonus liquidators receive to liquidate this asset. The values is always above 100%. A value of 105%
* means the liquidator will receive a 5% bonus
**/
function configureReserveAsCollateral(
address asset,
uint256 ltv,
uint256 liquidationThreshold,
uint256 liquidationBonus
) external onlyPoolAdmin {
}
/**
* @dev Enable stable rate borrowing on a reserve
* @param asset The address of the underlying asset of the reserve
**/
function enableReserveStableRate(address asset) external onlyPoolAdmin {
}
/**
* @dev Disable stable rate borrowing on a reserve
* @param asset The address of the underlying asset of the reserve
**/
function disableReserveStableRate(address asset) external onlyPoolAdmin {
}
/**
* @dev Activates a reserve
* @param asset The address of the underlying asset of the reserve
**/
function activateReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Deactivates a reserve
* @param asset The address of the underlying asset of the reserve
**/
function deactivateReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Freezes a reserve. A frozen reserve doesn't allow any new deposit, borrow or rate swap
* but allows repayments, liquidations, rate rebalances and withdrawals
* @param asset The address of the underlying asset of the reserve
**/
function freezeReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Unfreezes a reserve
* @param asset The address of the underlying asset of the reserve
**/
function unfreezeReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Updates the reserve factor of a reserve
* @param asset The address of the underlying asset of the reserve
* @param reserveFactor The new reserve factor of the reserve
**/
function setReserveFactor(address asset, uint256 reserveFactor) external onlyPoolAdmin {
}
/**
* @dev Sets the interest rate strategy of a reserve
* @param asset The address of the underlying asset of the reserve
* @param rateStrategyAddress The new address of the interest strategy contract
**/
function setReserveInterestRateStrategyAddress(address asset, address rateStrategyAddress)
external
onlyPoolAdmin
{
}
/**
* @dev pauses or unpauses all the actions of the protocol, including aToken transfers
* @param val true if protocol needs to be paused, false otherwise
**/
function setPoolPause(bool val) external onlyEmergencyAdmin {
}
function _initTokenWithProxy(address implementation, bytes memory initParams)
internal
returns (address)
{
}
function _upgradeTokenImplementation(
address proxyAddress,
address implementation,
bytes memory initParams
) internal {
}
function _checkNoLiquidity(address asset) internal view {
}
}
| addressesProvider.getEmergencyAdmin()==msg.sender,Errors.LPC_CALLER_NOT_EMERGENCY_ADMIN | 166,514 | addressesProvider.getEmergencyAdmin()==msg.sender |
Errors.LPC_INVALID_CONFIGURATION | // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
import {
InitializableImmutableAdminUpgradeabilityProxy
} from '../libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol';
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol';
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
import {ILendingPool} from '../../interfaces/ILendingPool.sol';
import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol';
import {Errors} from '../libraries/helpers/Errors.sol';
import {PercentageMath} from '../libraries/math/PercentageMath.sol';
import {DataTypes} from '../libraries/types/DataTypes.sol';
import {IInitializableDebtToken} from '../../interfaces/IInitializableDebtToken.sol';
import {IInitializableAToken} from '../../interfaces/IInitializableAToken.sol';
import {IChefIncentivesController} from '../../interfaces/IChefIncentivesController.sol';
import {ILendingPoolConfigurator} from '../../interfaces/ILendingPoolConfigurator.sol';
import {IMultiFeeDistribution} from '../../interfaces/IMultiFeeDistribution.sol';
/**
* @title LendingPoolConfigurator contract
* @author Aave
* @dev Implements the configuration methods for the Aave protocol
**/
contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigurator {
using SafeMath for uint256;
using PercentageMath for uint256;
using ReserveConfiguration for DataTypes.ReserveConfigurationMap;
ILendingPoolAddressesProvider internal addressesProvider;
ILendingPool internal pool;
modifier onlyPoolAdmin {
}
modifier onlyEmergencyAdmin {
}
uint256 internal constant CONFIGURATOR_REVISION = 0x1;
function getRevision() internal pure override returns (uint256) {
}
function initialize(ILendingPoolAddressesProvider provider) public initializer {
}
/**
* @dev Initializes reserves in batch
**/
function batchInitReserve(InitReserveInput[] calldata input) external onlyPoolAdmin {
}
function _initReserve(ILendingPool pool, InitReserveInput calldata input) internal {
}
/**
* @dev Updates the aToken implementation for the reserve
**/
function updateAToken(UpdateATokenInput calldata input) external onlyPoolAdmin {
}
/**
* @dev Updates the stable debt token implementation for the reserve
**/
function updateStableDebtToken(UpdateDebtTokenInput calldata input) external onlyPoolAdmin {
}
/**
* @dev Updates the variable debt token implementation for the asset
**/
function updateVariableDebtToken(UpdateDebtTokenInput calldata input) external onlyPoolAdmin {
}
/**
* @dev Enables borrowing on a reserve
* @param asset The address of the underlying asset of the reserve
* @param stableBorrowRateEnabled True if stable borrow rate needs to be enabled by default on this reserve
**/
function enableBorrowingOnReserve(address asset, bool stableBorrowRateEnabled)
external
onlyPoolAdmin
{
}
/**
* @dev Disables borrowing on a reserve
* @param asset The address of the underlying asset of the reserve
**/
function disableBorrowingOnReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Configures the reserve collateralization parameters
* all the values are expressed in percentages with two decimals of precision. A valid value is 10000, which means 100.00%
* @param asset The address of the underlying asset of the reserve
* @param ltv The loan to value of the asset when used as collateral
* @param liquidationThreshold The threshold at which loans using this asset as collateral will be considered undercollateralized
* @param liquidationBonus The bonus liquidators receive to liquidate this asset. The values is always above 100%. A value of 105%
* means the liquidator will receive a 5% bonus
**/
function configureReserveAsCollateral(
address asset,
uint256 ltv,
uint256 liquidationThreshold,
uint256 liquidationBonus
) external onlyPoolAdmin {
DataTypes.ReserveConfigurationMap memory currentConfig = pool.getConfiguration(asset);
//validation of the parameters: the LTV can
//only be lower or equal than the liquidation threshold
//(otherwise a loan against the asset would cause instantaneous liquidation)
require(ltv <= liquidationThreshold, Errors.LPC_INVALID_CONFIGURATION);
if (liquidationThreshold != 0) {
//liquidation bonus must be bigger than 100.00%, otherwise the liquidator would receive less
//collateral than needed to cover the debt
require(
liquidationBonus > PercentageMath.PERCENTAGE_FACTOR,
Errors.LPC_INVALID_CONFIGURATION
);
//if threshold * bonus is less than PERCENTAGE_FACTOR, it's guaranteed that at the moment
//a loan is taken there is enough collateral available to cover the liquidation bonus
require(<FILL_ME>)
} else {
require(liquidationBonus == 0, Errors.LPC_INVALID_CONFIGURATION);
//if the liquidation threshold is being set to 0,
// the reserve is being disabled as collateral. To do so,
//we need to ensure no liquidity is deposited
_checkNoLiquidity(asset);
}
currentConfig.setLtv(ltv);
currentConfig.setLiquidationThreshold(liquidationThreshold);
currentConfig.setLiquidationBonus(liquidationBonus);
pool.setConfiguration(asset, currentConfig.data);
emit CollateralConfigurationChanged(asset, ltv, liquidationThreshold, liquidationBonus);
}
/**
* @dev Enable stable rate borrowing on a reserve
* @param asset The address of the underlying asset of the reserve
**/
function enableReserveStableRate(address asset) external onlyPoolAdmin {
}
/**
* @dev Disable stable rate borrowing on a reserve
* @param asset The address of the underlying asset of the reserve
**/
function disableReserveStableRate(address asset) external onlyPoolAdmin {
}
/**
* @dev Activates a reserve
* @param asset The address of the underlying asset of the reserve
**/
function activateReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Deactivates a reserve
* @param asset The address of the underlying asset of the reserve
**/
function deactivateReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Freezes a reserve. A frozen reserve doesn't allow any new deposit, borrow or rate swap
* but allows repayments, liquidations, rate rebalances and withdrawals
* @param asset The address of the underlying asset of the reserve
**/
function freezeReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Unfreezes a reserve
* @param asset The address of the underlying asset of the reserve
**/
function unfreezeReserve(address asset) external onlyPoolAdmin {
}
/**
* @dev Updates the reserve factor of a reserve
* @param asset The address of the underlying asset of the reserve
* @param reserveFactor The new reserve factor of the reserve
**/
function setReserveFactor(address asset, uint256 reserveFactor) external onlyPoolAdmin {
}
/**
* @dev Sets the interest rate strategy of a reserve
* @param asset The address of the underlying asset of the reserve
* @param rateStrategyAddress The new address of the interest strategy contract
**/
function setReserveInterestRateStrategyAddress(address asset, address rateStrategyAddress)
external
onlyPoolAdmin
{
}
/**
* @dev pauses or unpauses all the actions of the protocol, including aToken transfers
* @param val true if protocol needs to be paused, false otherwise
**/
function setPoolPause(bool val) external onlyEmergencyAdmin {
}
function _initTokenWithProxy(address implementation, bytes memory initParams)
internal
returns (address)
{
}
function _upgradeTokenImplementation(
address proxyAddress,
address implementation,
bytes memory initParams
) internal {
}
function _checkNoLiquidity(address asset) internal view {
}
}
| liquidationThreshold.percentMul(liquidationBonus)<=PercentageMath.PERCENTAGE_FACTOR,Errors.LPC_INVALID_CONFIGURATION | 166,514 | liquidationThreshold.percentMul(liquidationBonus)<=PercentageMath.PERCENTAGE_FACTOR |
"PropyAddressController: Caller is not a Verifier" | // Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.3;
import "../openzeppelin-contracts/contracts/access/AccessControl.sol";
import "./IAddressController.sol";
contract PropyAddressController is AccessControl, IAddressController {
bytes32 public constant VERIFIER_ROLE = keccak256("VERIFIER_ROLE"); //verifies addresses
mapping(address => bool) public verifiedRecipients;
constructor(address _propyControllerAddress) {
}
modifier onlyAdmin() {
}
modifier onlyVerifier() {
require(<FILL_ME>)
_;
}
// let payload = ethers.utils.defaultAbiCoder.encode([ "address" ], [ addr2.address ]);
// let payloadHash = ethers.utils.keccak256(payload);
// let messageHashBytes = ethers.utils.arrayify(payloadHash)
// let flatSig = await controller1.signMessage(messageHashBytes);
// let sig = await ethers.utils.splitSignature(flatSig);
// await propy.connect(addr1).setVerifiedAddress(addr2.address, sig.v, sig.r, sig.s);
function setVerifiedAddressMeta(address userAddress, uint8 v, bytes32 r, bytes32 s) public {
}
function setVerifiedAddress(address _userAddress, bool _verified) public override onlyVerifier {
}
function verifyHash(bytes32 hash, uint8 v, bytes32 r, bytes32 s) public pure returns (address signer) {
}
function isVerified(address checkAddress) public override view returns (bool) {
}
}
| hasRole(VERIFIER_ROLE,msg.sender),"PropyAddressController: Caller is not a Verifier" | 166,544 | hasRole(VERIFIER_ROLE,msg.sender) |
"PropyAddressController: Invalid signature provided" | // Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.3;
import "../openzeppelin-contracts/contracts/access/AccessControl.sol";
import "./IAddressController.sol";
contract PropyAddressController is AccessControl, IAddressController {
bytes32 public constant VERIFIER_ROLE = keccak256("VERIFIER_ROLE"); //verifies addresses
mapping(address => bool) public verifiedRecipients;
constructor(address _propyControllerAddress) {
}
modifier onlyAdmin() {
}
modifier onlyVerifier() {
}
// let payload = ethers.utils.defaultAbiCoder.encode([ "address" ], [ addr2.address ]);
// let payloadHash = ethers.utils.keccak256(payload);
// let messageHashBytes = ethers.utils.arrayify(payloadHash)
// let flatSig = await controller1.signMessage(messageHashBytes);
// let sig = await ethers.utils.splitSignature(flatSig);
// await propy.connect(addr1).setVerifiedAddress(addr2.address, sig.v, sig.r, sig.s);
function setVerifiedAddressMeta(address userAddress, uint8 v, bytes32 r, bytes32 s) public {
bytes32 payloadHash = keccak256(abi.encode(userAddress));
address signer = verifyHash(payloadHash, v, r, s);
require(<FILL_ME>)
verifiedRecipients[userAddress] = true;
//emit event?
emit AddressVerified(signer, userAddress);
}
function setVerifiedAddress(address _userAddress, bool _verified) public override onlyVerifier {
}
function verifyHash(bytes32 hash, uint8 v, bytes32 r, bytes32 s) public pure returns (address signer) {
}
function isVerified(address checkAddress) public override view returns (bool) {
}
}
| hasRole(VERIFIER_ROLE,signer)==true,"PropyAddressController: Invalid signature provided" | 166,544 | hasRole(VERIFIER_ROLE,signer)==true |
'MARToken: array data error' | // SPDX-License-Identifier: MIT
// based on OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)
pragma solidity 0.8.17;
import { IERC20Metadata } from './interfaces/IERC20Metadata.sol';
/**
* @title Implementation of the IERC20 & IERC20Metadata interfaces in celebration of the
* SUCCESS of the Moroccan National Soccer Team
* at the 22nd FIFA World Cup in Qatar from 20 November to 18 December 2022
*
* The token has no owner exclusive functions, a capped total supply, and is not upgradable
* for a maximum amount of trust in the code.
*/
contract MARToken is IERC20Metadata {
//============================================================================
// Private State Variables
//============================================================================
uint8 private _decimals;
uint256 private _totalSupply;
string private _name;
string private _symbol;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
//============================================================================
// Constructor
//============================================================================
/**
* @dev Sets immutable values for {name}, {symbol}, {decimals}, {totalSupply}, and {referee}.
* {referee} gets receives the initial total supply and distributes it according to our tokenomics
*/
constructor(
string memory name_,
string memory symbol_,
uint8 decimals_,
uint256 totalSupply_,
address referee_
) {
}
/**
* @dev Returns the name of the token.
*/
function name() external view virtual override returns (string memory) {
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() external view virtual override returns (string memory) {
}
/**
* @dev Returns the number of decimals used to get its user representation.
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei.
*/
function decimals() external view virtual override returns (uint8) {
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() external view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) external virtual override returns (bool) {
}
/**
* @dev Can be used for airdrop
*
* Requirements:
*
* - `tos` and `amounts` must have the same length.
* - `tos` and `amounts` can not be empty.
* - zero address can not be part of `tos`.
* - the caller must have a balance of at least the some of all amounts.
*/
function batchTransfer(
address[] calldata tos,
uint256[] calldata amounts
) external virtual returns (bool) {
uint256 arrayLength = tos.length;
require(arrayLength == amounts.length, 'MARToken: array length mismatch');
require(arrayLength != 0, 'MARToken: arrays can not be empty');
for (uint256 i = 0; i < arrayLength; i++) {
require(<FILL_ME>)
require(amounts[i] <= balanceOf(msg.sender), 'MARToken: insufficient balance');
_transfer(msg.sender, tos[i], amounts[i]);
}
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(
address owner,
address spender
) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) external virtual override returns (bool) {
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external virtual override returns (bool) {
}
//============================================================================
// Private Functions
//============================================================================
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(address from, address to, uint256 amount) private {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) private {
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 amount) private {
}
}
| tos[i]!=address(0)&&amounts[i]!=0,'MARToken: array data error' | 166,572 | tos[i]!=address(0)&&amounts[i]!=0 |
'MARToken: insufficient balance' | // SPDX-License-Identifier: MIT
// based on OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)
pragma solidity 0.8.17;
import { IERC20Metadata } from './interfaces/IERC20Metadata.sol';
/**
* @title Implementation of the IERC20 & IERC20Metadata interfaces in celebration of the
* SUCCESS of the Moroccan National Soccer Team
* at the 22nd FIFA World Cup in Qatar from 20 November to 18 December 2022
*
* The token has no owner exclusive functions, a capped total supply, and is not upgradable
* for a maximum amount of trust in the code.
*/
contract MARToken is IERC20Metadata {
//============================================================================
// Private State Variables
//============================================================================
uint8 private _decimals;
uint256 private _totalSupply;
string private _name;
string private _symbol;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
//============================================================================
// Constructor
//============================================================================
/**
* @dev Sets immutable values for {name}, {symbol}, {decimals}, {totalSupply}, and {referee}.
* {referee} gets receives the initial total supply and distributes it according to our tokenomics
*/
constructor(
string memory name_,
string memory symbol_,
uint8 decimals_,
uint256 totalSupply_,
address referee_
) {
}
/**
* @dev Returns the name of the token.
*/
function name() external view virtual override returns (string memory) {
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() external view virtual override returns (string memory) {
}
/**
* @dev Returns the number of decimals used to get its user representation.
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei.
*/
function decimals() external view virtual override returns (uint8) {
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() external view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) external virtual override returns (bool) {
}
/**
* @dev Can be used for airdrop
*
* Requirements:
*
* - `tos` and `amounts` must have the same length.
* - `tos` and `amounts` can not be empty.
* - zero address can not be part of `tos`.
* - the caller must have a balance of at least the some of all amounts.
*/
function batchTransfer(
address[] calldata tos,
uint256[] calldata amounts
) external virtual returns (bool) {
uint256 arrayLength = tos.length;
require(arrayLength == amounts.length, 'MARToken: array length mismatch');
require(arrayLength != 0, 'MARToken: arrays can not be empty');
for (uint256 i = 0; i < arrayLength; i++) {
require(tos[i] != address(0) && amounts[i] != 0, 'MARToken: array data error');
require(<FILL_ME>)
_transfer(msg.sender, tos[i], amounts[i]);
}
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(
address owner,
address spender
) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) external virtual override returns (bool) {
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external virtual override returns (bool) {
}
//============================================================================
// Private Functions
//============================================================================
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(address from, address to, uint256 amount) private {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) private {
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 amount) private {
}
}
| amounts[i]<=balanceOf(msg.sender),'MARToken: insufficient balance' | 166,572 | amounts[i]<=balanceOf(msg.sender) |
null | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
durationSeconds_poolParam[duration] = ppm;
require(<FILL_ME>)
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| durationSeconds_poolParam[0].collateralFactorBPS==0 | 166,619 | durationSeconds_poolParam[0].collateralFactorBPS==0 |
"Amount exceed block limit" | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
blockLoanAmount[block.number] += loanAmount;
require(<FILL_ME>)
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| blockLoanAmount[block.number]<blockLoanLimit,"Amount exceed block limit" | 166,619 | blockLoanAmount[block.number]<blockLoanLimit |
"SignatureVerifier: fake valuation provided!" | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
//valuation = x[0]
//nftID = x[1]
//uint256 loanDurationSeconds = x[2];
//uint256 expireAtBlock = x[3];
//uint256 borrowedAmount = x[4];
require(<FILL_ME>)
require(
IControlPlane01(_controlPlane).whitelistedIntermediaries(
msg.sender
) || msg.sender == tx.origin,
"Phishing!"
);
address contextUser = proxy ? tx.origin : msg.sender;
require(
!PineLendingLibrary.nftHasLoan(_loans[x[1]]),
"NFT already has loan!"
);
uint32 maxLTVBPS = durationSeconds_poolParam[x[2]].collateralFactorBPS;
require(maxLTVBPS > 0, "Duration not supported");
uint256 pineMirrorID = uint256(
keccak256(abi.encodePacked(_supportedCollection, x[1]))
);
if (pineWallet == (address(0))) {
require(
IERC721(_supportedCollection).ownerOf(x[1]) == contextUser,
"Stealer1!"
);
} else {
require(
ICloneFactory02(
IControlPlane01(_controlPlane).whitelistedFactory()
).genuineClone(pineWallet),
"Scammer!"
);
require(
IERC721(pineWallet).ownerOf(pineMirrorID) == contextUser,
"Stealer2!"
);
}
require(block.number < x[3], "Valuation expired");
require(
x[4] <= (x[0] * maxLTVBPS) / 10_000,
"Can't borrow more than max LTV"
);
require(
x[4] < IERC20(_supportedCurrency).balanceOf(_fundSource),
"not enough money"
);
uint32 protocolFeeBips = IControlPlane01(_controlPlane).feeBps();
uint256 protocolFee = (x[4] * (protocolFeeBips)) / (10000);
updateBlockLoanAmount(x[4]);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
msg.sender,
x[4] - protocolFee
);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
_controlPlane,
protocolFee
);
_loans[x[1]] = PineLendingLibrary.LoanTerms(
block.number,
block.timestamp + x[2],
durationSeconds_poolParam[x[2]].interestBPS1000000XBlock,
maxLTVBPS,
x[4],
0,
0,
0,
contextUser
);
if (pineWallet == (address(0))) {
IERC721(_supportedCollection).transferFrom(
contextUser,
address(this),
x[1]
);
} else {
IERC721(pineWallet).transferFrom(
contextUser,
address(this),
pineMirrorID
);
}
emit PineLendingLibrary.LoanInitiated(
contextUser,
_supportedCollection,
x[1],
_loans[x[1]]
);
return true;
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| VerifySignaturePool02.verify(_supportedCollection,x[1],x[0],x[3],_valuationSigner,signature),"SignatureVerifier: fake valuation provided!" | 166,619 | VerifySignaturePool02.verify(_supportedCollection,x[1],x[0],x[3],_valuationSigner,signature) |
"Phishing!" | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
//valuation = x[0]
//nftID = x[1]
//uint256 loanDurationSeconds = x[2];
//uint256 expireAtBlock = x[3];
//uint256 borrowedAmount = x[4];
require(
VerifySignaturePool02.verify(
_supportedCollection,
x[1],
x[0],
x[3],
_valuationSigner,
signature
),
"SignatureVerifier: fake valuation provided!"
);
require(<FILL_ME>)
address contextUser = proxy ? tx.origin : msg.sender;
require(
!PineLendingLibrary.nftHasLoan(_loans[x[1]]),
"NFT already has loan!"
);
uint32 maxLTVBPS = durationSeconds_poolParam[x[2]].collateralFactorBPS;
require(maxLTVBPS > 0, "Duration not supported");
uint256 pineMirrorID = uint256(
keccak256(abi.encodePacked(_supportedCollection, x[1]))
);
if (pineWallet == (address(0))) {
require(
IERC721(_supportedCollection).ownerOf(x[1]) == contextUser,
"Stealer1!"
);
} else {
require(
ICloneFactory02(
IControlPlane01(_controlPlane).whitelistedFactory()
).genuineClone(pineWallet),
"Scammer!"
);
require(
IERC721(pineWallet).ownerOf(pineMirrorID) == contextUser,
"Stealer2!"
);
}
require(block.number < x[3], "Valuation expired");
require(
x[4] <= (x[0] * maxLTVBPS) / 10_000,
"Can't borrow more than max LTV"
);
require(
x[4] < IERC20(_supportedCurrency).balanceOf(_fundSource),
"not enough money"
);
uint32 protocolFeeBips = IControlPlane01(_controlPlane).feeBps();
uint256 protocolFee = (x[4] * (protocolFeeBips)) / (10000);
updateBlockLoanAmount(x[4]);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
msg.sender,
x[4] - protocolFee
);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
_controlPlane,
protocolFee
);
_loans[x[1]] = PineLendingLibrary.LoanTerms(
block.number,
block.timestamp + x[2],
durationSeconds_poolParam[x[2]].interestBPS1000000XBlock,
maxLTVBPS,
x[4],
0,
0,
0,
contextUser
);
if (pineWallet == (address(0))) {
IERC721(_supportedCollection).transferFrom(
contextUser,
address(this),
x[1]
);
} else {
IERC721(pineWallet).transferFrom(
contextUser,
address(this),
pineMirrorID
);
}
emit PineLendingLibrary.LoanInitiated(
contextUser,
_supportedCollection,
x[1],
_loans[x[1]]
);
return true;
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| IControlPlane01(_controlPlane).whitelistedIntermediaries(msg.sender)||msg.sender==tx.origin,"Phishing!" | 166,619 | IControlPlane01(_controlPlane).whitelistedIntermediaries(msg.sender)||msg.sender==tx.origin |
"NFT already has loan!" | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
//valuation = x[0]
//nftID = x[1]
//uint256 loanDurationSeconds = x[2];
//uint256 expireAtBlock = x[3];
//uint256 borrowedAmount = x[4];
require(
VerifySignaturePool02.verify(
_supportedCollection,
x[1],
x[0],
x[3],
_valuationSigner,
signature
),
"SignatureVerifier: fake valuation provided!"
);
require(
IControlPlane01(_controlPlane).whitelistedIntermediaries(
msg.sender
) || msg.sender == tx.origin,
"Phishing!"
);
address contextUser = proxy ? tx.origin : msg.sender;
require(<FILL_ME>)
uint32 maxLTVBPS = durationSeconds_poolParam[x[2]].collateralFactorBPS;
require(maxLTVBPS > 0, "Duration not supported");
uint256 pineMirrorID = uint256(
keccak256(abi.encodePacked(_supportedCollection, x[1]))
);
if (pineWallet == (address(0))) {
require(
IERC721(_supportedCollection).ownerOf(x[1]) == contextUser,
"Stealer1!"
);
} else {
require(
ICloneFactory02(
IControlPlane01(_controlPlane).whitelistedFactory()
).genuineClone(pineWallet),
"Scammer!"
);
require(
IERC721(pineWallet).ownerOf(pineMirrorID) == contextUser,
"Stealer2!"
);
}
require(block.number < x[3], "Valuation expired");
require(
x[4] <= (x[0] * maxLTVBPS) / 10_000,
"Can't borrow more than max LTV"
);
require(
x[4] < IERC20(_supportedCurrency).balanceOf(_fundSource),
"not enough money"
);
uint32 protocolFeeBips = IControlPlane01(_controlPlane).feeBps();
uint256 protocolFee = (x[4] * (protocolFeeBips)) / (10000);
updateBlockLoanAmount(x[4]);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
msg.sender,
x[4] - protocolFee
);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
_controlPlane,
protocolFee
);
_loans[x[1]] = PineLendingLibrary.LoanTerms(
block.number,
block.timestamp + x[2],
durationSeconds_poolParam[x[2]].interestBPS1000000XBlock,
maxLTVBPS,
x[4],
0,
0,
0,
contextUser
);
if (pineWallet == (address(0))) {
IERC721(_supportedCollection).transferFrom(
contextUser,
address(this),
x[1]
);
} else {
IERC721(pineWallet).transferFrom(
contextUser,
address(this),
pineMirrorID
);
}
emit PineLendingLibrary.LoanInitiated(
contextUser,
_supportedCollection,
x[1],
_loans[x[1]]
);
return true;
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| !PineLendingLibrary.nftHasLoan(_loans[x[1]]),"NFT already has loan!" | 166,619 | !PineLendingLibrary.nftHasLoan(_loans[x[1]]) |
"Stealer1!" | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
//valuation = x[0]
//nftID = x[1]
//uint256 loanDurationSeconds = x[2];
//uint256 expireAtBlock = x[3];
//uint256 borrowedAmount = x[4];
require(
VerifySignaturePool02.verify(
_supportedCollection,
x[1],
x[0],
x[3],
_valuationSigner,
signature
),
"SignatureVerifier: fake valuation provided!"
);
require(
IControlPlane01(_controlPlane).whitelistedIntermediaries(
msg.sender
) || msg.sender == tx.origin,
"Phishing!"
);
address contextUser = proxy ? tx.origin : msg.sender;
require(
!PineLendingLibrary.nftHasLoan(_loans[x[1]]),
"NFT already has loan!"
);
uint32 maxLTVBPS = durationSeconds_poolParam[x[2]].collateralFactorBPS;
require(maxLTVBPS > 0, "Duration not supported");
uint256 pineMirrorID = uint256(
keccak256(abi.encodePacked(_supportedCollection, x[1]))
);
if (pineWallet == (address(0))) {
require(<FILL_ME>)
} else {
require(
ICloneFactory02(
IControlPlane01(_controlPlane).whitelistedFactory()
).genuineClone(pineWallet),
"Scammer!"
);
require(
IERC721(pineWallet).ownerOf(pineMirrorID) == contextUser,
"Stealer2!"
);
}
require(block.number < x[3], "Valuation expired");
require(
x[4] <= (x[0] * maxLTVBPS) / 10_000,
"Can't borrow more than max LTV"
);
require(
x[4] < IERC20(_supportedCurrency).balanceOf(_fundSource),
"not enough money"
);
uint32 protocolFeeBips = IControlPlane01(_controlPlane).feeBps();
uint256 protocolFee = (x[4] * (protocolFeeBips)) / (10000);
updateBlockLoanAmount(x[4]);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
msg.sender,
x[4] - protocolFee
);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
_controlPlane,
protocolFee
);
_loans[x[1]] = PineLendingLibrary.LoanTerms(
block.number,
block.timestamp + x[2],
durationSeconds_poolParam[x[2]].interestBPS1000000XBlock,
maxLTVBPS,
x[4],
0,
0,
0,
contextUser
);
if (pineWallet == (address(0))) {
IERC721(_supportedCollection).transferFrom(
contextUser,
address(this),
x[1]
);
} else {
IERC721(pineWallet).transferFrom(
contextUser,
address(this),
pineMirrorID
);
}
emit PineLendingLibrary.LoanInitiated(
contextUser,
_supportedCollection,
x[1],
_loans[x[1]]
);
return true;
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| IERC721(_supportedCollection).ownerOf(x[1])==contextUser,"Stealer1!" | 166,619 | IERC721(_supportedCollection).ownerOf(x[1])==contextUser |
"Scammer!" | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
//valuation = x[0]
//nftID = x[1]
//uint256 loanDurationSeconds = x[2];
//uint256 expireAtBlock = x[3];
//uint256 borrowedAmount = x[4];
require(
VerifySignaturePool02.verify(
_supportedCollection,
x[1],
x[0],
x[3],
_valuationSigner,
signature
),
"SignatureVerifier: fake valuation provided!"
);
require(
IControlPlane01(_controlPlane).whitelistedIntermediaries(
msg.sender
) || msg.sender == tx.origin,
"Phishing!"
);
address contextUser = proxy ? tx.origin : msg.sender;
require(
!PineLendingLibrary.nftHasLoan(_loans[x[1]]),
"NFT already has loan!"
);
uint32 maxLTVBPS = durationSeconds_poolParam[x[2]].collateralFactorBPS;
require(maxLTVBPS > 0, "Duration not supported");
uint256 pineMirrorID = uint256(
keccak256(abi.encodePacked(_supportedCollection, x[1]))
);
if (pineWallet == (address(0))) {
require(
IERC721(_supportedCollection).ownerOf(x[1]) == contextUser,
"Stealer1!"
);
} else {
require(<FILL_ME>)
require(
IERC721(pineWallet).ownerOf(pineMirrorID) == contextUser,
"Stealer2!"
);
}
require(block.number < x[3], "Valuation expired");
require(
x[4] <= (x[0] * maxLTVBPS) / 10_000,
"Can't borrow more than max LTV"
);
require(
x[4] < IERC20(_supportedCurrency).balanceOf(_fundSource),
"not enough money"
);
uint32 protocolFeeBips = IControlPlane01(_controlPlane).feeBps();
uint256 protocolFee = (x[4] * (protocolFeeBips)) / (10000);
updateBlockLoanAmount(x[4]);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
msg.sender,
x[4] - protocolFee
);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
_controlPlane,
protocolFee
);
_loans[x[1]] = PineLendingLibrary.LoanTerms(
block.number,
block.timestamp + x[2],
durationSeconds_poolParam[x[2]].interestBPS1000000XBlock,
maxLTVBPS,
x[4],
0,
0,
0,
contextUser
);
if (pineWallet == (address(0))) {
IERC721(_supportedCollection).transferFrom(
contextUser,
address(this),
x[1]
);
} else {
IERC721(pineWallet).transferFrom(
contextUser,
address(this),
pineMirrorID
);
}
emit PineLendingLibrary.LoanInitiated(
contextUser,
_supportedCollection,
x[1],
_loans[x[1]]
);
return true;
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| ICloneFactory02(IControlPlane01(_controlPlane).whitelistedFactory()).genuineClone(pineWallet),"Scammer!" | 166,619 | ICloneFactory02(IControlPlane01(_controlPlane).whitelistedFactory()).genuineClone(pineWallet) |
"Stealer2!" | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
//valuation = x[0]
//nftID = x[1]
//uint256 loanDurationSeconds = x[2];
//uint256 expireAtBlock = x[3];
//uint256 borrowedAmount = x[4];
require(
VerifySignaturePool02.verify(
_supportedCollection,
x[1],
x[0],
x[3],
_valuationSigner,
signature
),
"SignatureVerifier: fake valuation provided!"
);
require(
IControlPlane01(_controlPlane).whitelistedIntermediaries(
msg.sender
) || msg.sender == tx.origin,
"Phishing!"
);
address contextUser = proxy ? tx.origin : msg.sender;
require(
!PineLendingLibrary.nftHasLoan(_loans[x[1]]),
"NFT already has loan!"
);
uint32 maxLTVBPS = durationSeconds_poolParam[x[2]].collateralFactorBPS;
require(maxLTVBPS > 0, "Duration not supported");
uint256 pineMirrorID = uint256(
keccak256(abi.encodePacked(_supportedCollection, x[1]))
);
if (pineWallet == (address(0))) {
require(
IERC721(_supportedCollection).ownerOf(x[1]) == contextUser,
"Stealer1!"
);
} else {
require(
ICloneFactory02(
IControlPlane01(_controlPlane).whitelistedFactory()
).genuineClone(pineWallet),
"Scammer!"
);
require(<FILL_ME>)
}
require(block.number < x[3], "Valuation expired");
require(
x[4] <= (x[0] * maxLTVBPS) / 10_000,
"Can't borrow more than max LTV"
);
require(
x[4] < IERC20(_supportedCurrency).balanceOf(_fundSource),
"not enough money"
);
uint32 protocolFeeBips = IControlPlane01(_controlPlane).feeBps();
uint256 protocolFee = (x[4] * (protocolFeeBips)) / (10000);
updateBlockLoanAmount(x[4]);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
msg.sender,
x[4] - protocolFee
);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
_controlPlane,
protocolFee
);
_loans[x[1]] = PineLendingLibrary.LoanTerms(
block.number,
block.timestamp + x[2],
durationSeconds_poolParam[x[2]].interestBPS1000000XBlock,
maxLTVBPS,
x[4],
0,
0,
0,
contextUser
);
if (pineWallet == (address(0))) {
IERC721(_supportedCollection).transferFrom(
contextUser,
address(this),
x[1]
);
} else {
IERC721(pineWallet).transferFrom(
contextUser,
address(this),
pineMirrorID
);
}
emit PineLendingLibrary.LoanInitiated(
contextUser,
_supportedCollection,
x[1],
_loans[x[1]]
);
return true;
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| IERC721(pineWallet).ownerOf(pineMirrorID)==contextUser,"Stealer2!" | 166,619 | IERC721(pineWallet).ownerOf(pineMirrorID)==contextUser |
"Can't borrow more than max LTV" | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
//valuation = x[0]
//nftID = x[1]
//uint256 loanDurationSeconds = x[2];
//uint256 expireAtBlock = x[3];
//uint256 borrowedAmount = x[4];
require(
VerifySignaturePool02.verify(
_supportedCollection,
x[1],
x[0],
x[3],
_valuationSigner,
signature
),
"SignatureVerifier: fake valuation provided!"
);
require(
IControlPlane01(_controlPlane).whitelistedIntermediaries(
msg.sender
) || msg.sender == tx.origin,
"Phishing!"
);
address contextUser = proxy ? tx.origin : msg.sender;
require(
!PineLendingLibrary.nftHasLoan(_loans[x[1]]),
"NFT already has loan!"
);
uint32 maxLTVBPS = durationSeconds_poolParam[x[2]].collateralFactorBPS;
require(maxLTVBPS > 0, "Duration not supported");
uint256 pineMirrorID = uint256(
keccak256(abi.encodePacked(_supportedCollection, x[1]))
);
if (pineWallet == (address(0))) {
require(
IERC721(_supportedCollection).ownerOf(x[1]) == contextUser,
"Stealer1!"
);
} else {
require(
ICloneFactory02(
IControlPlane01(_controlPlane).whitelistedFactory()
).genuineClone(pineWallet),
"Scammer!"
);
require(
IERC721(pineWallet).ownerOf(pineMirrorID) == contextUser,
"Stealer2!"
);
}
require(block.number < x[3], "Valuation expired");
require(<FILL_ME>)
require(
x[4] < IERC20(_supportedCurrency).balanceOf(_fundSource),
"not enough money"
);
uint32 protocolFeeBips = IControlPlane01(_controlPlane).feeBps();
uint256 protocolFee = (x[4] * (protocolFeeBips)) / (10000);
updateBlockLoanAmount(x[4]);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
msg.sender,
x[4] - protocolFee
);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
_controlPlane,
protocolFee
);
_loans[x[1]] = PineLendingLibrary.LoanTerms(
block.number,
block.timestamp + x[2],
durationSeconds_poolParam[x[2]].interestBPS1000000XBlock,
maxLTVBPS,
x[4],
0,
0,
0,
contextUser
);
if (pineWallet == (address(0))) {
IERC721(_supportedCollection).transferFrom(
contextUser,
address(this),
x[1]
);
} else {
IERC721(pineWallet).transferFrom(
contextUser,
address(this),
pineMirrorID
);
}
emit PineLendingLibrary.LoanInitiated(
contextUser,
_supportedCollection,
x[1],
_loans[x[1]]
);
return true;
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| x[4]<=(x[0]*maxLTVBPS)/10_000,"Can't borrow more than max LTV" | 166,619 | x[4]<=(x[0]*maxLTVBPS)/10_000 |
"not enough money" | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
//valuation = x[0]
//nftID = x[1]
//uint256 loanDurationSeconds = x[2];
//uint256 expireAtBlock = x[3];
//uint256 borrowedAmount = x[4];
require(
VerifySignaturePool02.verify(
_supportedCollection,
x[1],
x[0],
x[3],
_valuationSigner,
signature
),
"SignatureVerifier: fake valuation provided!"
);
require(
IControlPlane01(_controlPlane).whitelistedIntermediaries(
msg.sender
) || msg.sender == tx.origin,
"Phishing!"
);
address contextUser = proxy ? tx.origin : msg.sender;
require(
!PineLendingLibrary.nftHasLoan(_loans[x[1]]),
"NFT already has loan!"
);
uint32 maxLTVBPS = durationSeconds_poolParam[x[2]].collateralFactorBPS;
require(maxLTVBPS > 0, "Duration not supported");
uint256 pineMirrorID = uint256(
keccak256(abi.encodePacked(_supportedCollection, x[1]))
);
if (pineWallet == (address(0))) {
require(
IERC721(_supportedCollection).ownerOf(x[1]) == contextUser,
"Stealer1!"
);
} else {
require(
ICloneFactory02(
IControlPlane01(_controlPlane).whitelistedFactory()
).genuineClone(pineWallet),
"Scammer!"
);
require(
IERC721(pineWallet).ownerOf(pineMirrorID) == contextUser,
"Stealer2!"
);
}
require(block.number < x[3], "Valuation expired");
require(
x[4] <= (x[0] * maxLTVBPS) / 10_000,
"Can't borrow more than max LTV"
);
require(<FILL_ME>)
uint32 protocolFeeBips = IControlPlane01(_controlPlane).feeBps();
uint256 protocolFee = (x[4] * (protocolFeeBips)) / (10000);
updateBlockLoanAmount(x[4]);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
msg.sender,
x[4] - protocolFee
);
IERC20(_supportedCurrency).transferFrom(
_fundSource,
_controlPlane,
protocolFee
);
_loans[x[1]] = PineLendingLibrary.LoanTerms(
block.number,
block.timestamp + x[2],
durationSeconds_poolParam[x[2]].interestBPS1000000XBlock,
maxLTVBPS,
x[4],
0,
0,
0,
contextUser
);
if (pineWallet == (address(0))) {
IERC721(_supportedCollection).transferFrom(
contextUser,
address(this),
x[1]
);
} else {
IERC721(pineWallet).transferFrom(
contextUser,
address(this),
pineMirrorID
);
}
emit PineLendingLibrary.LoanInitiated(
contextUser,
_supportedCollection,
x[1],
_loans[x[1]]
);
return true;
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| x[4]<IERC20(_supportedCurrency).balanceOf(_fundSource),"not enough money" | 166,619 | x[4]<IERC20(_supportedCurrency).balanceOf(_fundSource) |
"NFT does not have active loan" | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
uint256 pineMirrorID = uint256(
keccak256(abi.encodePacked(_supportedCollection, nftID))
);
require(<FILL_ME>)
require(
IERC20(_supportedCurrency).transferFrom(
msg.sender,
address(this),
repayAmount
),
"fund transfer unsuccessful"
);
PineLendingLibrary.LoanTerms memory oldLoanTerms = _loans[nftID];
if (repayAmount >= PineLendingLibrary.outstanding(_loans[nftID])) {
require(
IERC20(_supportedCurrency).transfer(
msg.sender,
repayAmount - PineLendingLibrary.outstanding(_loans[nftID])
),
"exceed amount transfer unsuccessful"
);
repayAmount = PineLendingLibrary.outstanding(_loans[nftID]);
_loans[nftID].returnedWei = _loans[nftID].borrowedWei;
if (pineWallet == address(0)) {
IERC721(_supportedCollection).transferFrom(
address(this),
_loans[nftID].borrower,
nftID
);
} else {
require(
ICloneFactory02(
IControlPlane01(_controlPlane).whitelistedFactory()
).genuineClone(pineWallet),
"Scammer!"
);
IERC721(pineWallet).transferFrom(
address(this),
_loans[nftID].borrower,
pineMirrorID
);
}
clearLoanTerms(nftID);
} else {
// lump in interest
_loans[nftID].accuredInterestWei +=
((block.number - _loans[nftID].loanStartBlock) *
(_loans[nftID].borrowedWei - _loans[nftID].returnedWei) *
_loans[nftID].interestBPS1000000XBlock) /
10000000000;
uint256 outstandingInterest = _loans[nftID].accuredInterestWei -
_loans[nftID].repaidInterestWei;
if (repayAmount > outstandingInterest) {
_loans[nftID].repaidInterestWei = _loans[nftID]
.accuredInterestWei;
_loans[nftID].returnedWei += (repayAmount -
outstandingInterest);
} else {
_loans[nftID].repaidInterestWei += repayAmount;
}
// restart interest calculation
_loans[nftID].loanStartBlock = block.number;
}
require(
IERC20(_supportedCurrency).transferFrom(
address(this),
_fundSource,
IERC20(_supportedCurrency).balanceOf(address(this))
),
"fund transfer unsuccessful"
);
emit PineLendingLibrary.LoanTermsChanged(
_loans[nftID].borrower,
_supportedCollection,
nftID,
oldLoanTerms,
_loans[nftID]
);
return true;
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| PineLendingLibrary.nftHasLoan(_loans[nftID]),"NFT does not have active loan" | 166,619 | PineLendingLibrary.nftHasLoan(_loans[nftID]) |
"fund transfer unsuccessful" | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
uint256 pineMirrorID = uint256(
keccak256(abi.encodePacked(_supportedCollection, nftID))
);
require(
PineLendingLibrary.nftHasLoan(_loans[nftID]),
"NFT does not have active loan"
);
require(<FILL_ME>)
PineLendingLibrary.LoanTerms memory oldLoanTerms = _loans[nftID];
if (repayAmount >= PineLendingLibrary.outstanding(_loans[nftID])) {
require(
IERC20(_supportedCurrency).transfer(
msg.sender,
repayAmount - PineLendingLibrary.outstanding(_loans[nftID])
),
"exceed amount transfer unsuccessful"
);
repayAmount = PineLendingLibrary.outstanding(_loans[nftID]);
_loans[nftID].returnedWei = _loans[nftID].borrowedWei;
if (pineWallet == address(0)) {
IERC721(_supportedCollection).transferFrom(
address(this),
_loans[nftID].borrower,
nftID
);
} else {
require(
ICloneFactory02(
IControlPlane01(_controlPlane).whitelistedFactory()
).genuineClone(pineWallet),
"Scammer!"
);
IERC721(pineWallet).transferFrom(
address(this),
_loans[nftID].borrower,
pineMirrorID
);
}
clearLoanTerms(nftID);
} else {
// lump in interest
_loans[nftID].accuredInterestWei +=
((block.number - _loans[nftID].loanStartBlock) *
(_loans[nftID].borrowedWei - _loans[nftID].returnedWei) *
_loans[nftID].interestBPS1000000XBlock) /
10000000000;
uint256 outstandingInterest = _loans[nftID].accuredInterestWei -
_loans[nftID].repaidInterestWei;
if (repayAmount > outstandingInterest) {
_loans[nftID].repaidInterestWei = _loans[nftID]
.accuredInterestWei;
_loans[nftID].returnedWei += (repayAmount -
outstandingInterest);
} else {
_loans[nftID].repaidInterestWei += repayAmount;
}
// restart interest calculation
_loans[nftID].loanStartBlock = block.number;
}
require(
IERC20(_supportedCurrency).transferFrom(
address(this),
_fundSource,
IERC20(_supportedCurrency).balanceOf(address(this))
),
"fund transfer unsuccessful"
);
emit PineLendingLibrary.LoanTermsChanged(
_loans[nftID].borrower,
_supportedCollection,
nftID,
oldLoanTerms,
_loans[nftID]
);
return true;
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| IERC20(_supportedCurrency).transferFrom(msg.sender,address(this),repayAmount),"fund transfer unsuccessful" | 166,619 | IERC20(_supportedCurrency).transferFrom(msg.sender,address(this),repayAmount) |
"exceed amount transfer unsuccessful" | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
uint256 pineMirrorID = uint256(
keccak256(abi.encodePacked(_supportedCollection, nftID))
);
require(
PineLendingLibrary.nftHasLoan(_loans[nftID]),
"NFT does not have active loan"
);
require(
IERC20(_supportedCurrency).transferFrom(
msg.sender,
address(this),
repayAmount
),
"fund transfer unsuccessful"
);
PineLendingLibrary.LoanTerms memory oldLoanTerms = _loans[nftID];
if (repayAmount >= PineLendingLibrary.outstanding(_loans[nftID])) {
require(<FILL_ME>)
repayAmount = PineLendingLibrary.outstanding(_loans[nftID]);
_loans[nftID].returnedWei = _loans[nftID].borrowedWei;
if (pineWallet == address(0)) {
IERC721(_supportedCollection).transferFrom(
address(this),
_loans[nftID].borrower,
nftID
);
} else {
require(
ICloneFactory02(
IControlPlane01(_controlPlane).whitelistedFactory()
).genuineClone(pineWallet),
"Scammer!"
);
IERC721(pineWallet).transferFrom(
address(this),
_loans[nftID].borrower,
pineMirrorID
);
}
clearLoanTerms(nftID);
} else {
// lump in interest
_loans[nftID].accuredInterestWei +=
((block.number - _loans[nftID].loanStartBlock) *
(_loans[nftID].borrowedWei - _loans[nftID].returnedWei) *
_loans[nftID].interestBPS1000000XBlock) /
10000000000;
uint256 outstandingInterest = _loans[nftID].accuredInterestWei -
_loans[nftID].repaidInterestWei;
if (repayAmount > outstandingInterest) {
_loans[nftID].repaidInterestWei = _loans[nftID]
.accuredInterestWei;
_loans[nftID].returnedWei += (repayAmount -
outstandingInterest);
} else {
_loans[nftID].repaidInterestWei += repayAmount;
}
// restart interest calculation
_loans[nftID].loanStartBlock = block.number;
}
require(
IERC20(_supportedCurrency).transferFrom(
address(this),
_fundSource,
IERC20(_supportedCurrency).balanceOf(address(this))
),
"fund transfer unsuccessful"
);
emit PineLendingLibrary.LoanTermsChanged(
_loans[nftID].borrower,
_supportedCollection,
nftID,
oldLoanTerms,
_loans[nftID]
);
return true;
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| IERC20(_supportedCurrency).transfer(msg.sender,repayAmount-PineLendingLibrary.outstanding(_loans[nftID])),"exceed amount transfer unsuccessful" | 166,619 | IERC20(_supportedCurrency).transfer(msg.sender,repayAmount-PineLendingLibrary.outstanding(_loans[nftID])) |
"fund transfer unsuccessful" | pragma solidity 0.8.3;
contract ERC721LendingPool02 is
OwnableUpgradeable,
IERC721Receiver,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC1155Holder
{
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) public pure override returns (bytes4) {
}
/**
* Pool Constants
*/
address public _valuationSigner;
address public _supportedCollection;
address public _controlPlane;
address public _fundSource;
address public _supportedCurrency;
struct PoolParams {
uint32 interestBPS1000000XBlock;
uint32 collateralFactorBPS;
}
mapping(uint256 => PoolParams) public durationSeconds_poolParam;
mapping(uint256 => uint256) public blockLoanAmount;
uint256 public blockLoanLimit;
/**
* Pool Setup
*/
function initialize(
address supportedCollection,
address valuationSigner,
address controlPlane,
address supportedCurrency,
address fundSource
) public initializer {
}
function setBlockLoanLimit(uint256 bll) public onlyOwner {
}
function setDurationParam(uint256 duration, PoolParams calldata ppm)
public
onlyOwner
{
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function updateBlockLoanAmount(uint256 loanAmount) internal {
}
/**
* Storage and Events
*/
mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;
/**
* Loan origination
*/
function flashLoan(
address payable _receiver,
address _reserve,
uint256 _amount,
bytes memory _params
) external nonReentrant {
}
function borrow(
uint256[5] calldata x,
bytes memory signature,
bool proxy,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
}
/**
* Repay
*/
// repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
function repay(
uint256 nftID,
uint256 repayAmount,
address pineWallet
) external nonReentrant whenNotPaused returns (bool) {
uint256 pineMirrorID = uint256(
keccak256(abi.encodePacked(_supportedCollection, nftID))
);
require(
PineLendingLibrary.nftHasLoan(_loans[nftID]),
"NFT does not have active loan"
);
require(
IERC20(_supportedCurrency).transferFrom(
msg.sender,
address(this),
repayAmount
),
"fund transfer unsuccessful"
);
PineLendingLibrary.LoanTerms memory oldLoanTerms = _loans[nftID];
if (repayAmount >= PineLendingLibrary.outstanding(_loans[nftID])) {
require(
IERC20(_supportedCurrency).transfer(
msg.sender,
repayAmount - PineLendingLibrary.outstanding(_loans[nftID])
),
"exceed amount transfer unsuccessful"
);
repayAmount = PineLendingLibrary.outstanding(_loans[nftID]);
_loans[nftID].returnedWei = _loans[nftID].borrowedWei;
if (pineWallet == address(0)) {
IERC721(_supportedCollection).transferFrom(
address(this),
_loans[nftID].borrower,
nftID
);
} else {
require(
ICloneFactory02(
IControlPlane01(_controlPlane).whitelistedFactory()
).genuineClone(pineWallet),
"Scammer!"
);
IERC721(pineWallet).transferFrom(
address(this),
_loans[nftID].borrower,
pineMirrorID
);
}
clearLoanTerms(nftID);
} else {
// lump in interest
_loans[nftID].accuredInterestWei +=
((block.number - _loans[nftID].loanStartBlock) *
(_loans[nftID].borrowedWei - _loans[nftID].returnedWei) *
_loans[nftID].interestBPS1000000XBlock) /
10000000000;
uint256 outstandingInterest = _loans[nftID].accuredInterestWei -
_loans[nftID].repaidInterestWei;
if (repayAmount > outstandingInterest) {
_loans[nftID].repaidInterestWei = _loans[nftID]
.accuredInterestWei;
_loans[nftID].returnedWei += (repayAmount -
outstandingInterest);
} else {
_loans[nftID].repaidInterestWei += repayAmount;
}
// restart interest calculation
_loans[nftID].loanStartBlock = block.number;
}
require(<FILL_ME>)
emit PineLendingLibrary.LoanTermsChanged(
_loans[nftID].borrower,
_supportedCollection,
nftID,
oldLoanTerms,
_loans[nftID]
);
return true;
}
/**
* Admin functions
*/
function withdraw(uint256 amount) external onlyOwner {
}
function withdrawERC20(address currency, uint256 amount)
external
onlyOwner
{
}
function withdrawERC1155(address currency, uint256 id, uint256 amount)
external
onlyOwner
{
}
function withdrawERC721(
address collection,
uint256 nftID,
address target,
bool liquidation
) external {
}
function clearLoanTerms(uint256 nftID) internal {
}
}
| IERC20(_supportedCurrency).transferFrom(address(this),_fundSource,IERC20(_supportedCurrency).balanceOf(address(this))),"fund transfer unsuccessful" | 166,619 | IERC20(_supportedCurrency).transferFrom(address(this),_fundSource,IERC20(_supportedCurrency).balanceOf(address(this))) |
"Exceeds maximum tokens per wallet" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
contract UnitedAgainstWar is ERC721A, Ownable {
string public baseURI;
bytes32 public merkleRoot;
bool public paused = false;
uint256 public maxSupply = 11111;
uint256 public maxPerTx = 5;
uint256 public maxPerWallet = 10;
bool public publicActive = false;
uint256 public publicPrice = 0.05 ether;
bool public whitelistActive = false;
uint256 public whitelistPrice = 0.04 ether;
address internal proxyRegistryAddress = 0xa5409ec958C83C3f309868babACA7c86DCB077c1;
constructor() ERC721A("United Against War", "UAW") {}
/**
* @notice Mint token(s) to your own address
*/
function publicMint(uint256 _quantity) external payable {
address _to = msg.sender;
uint256 _value = msg.value;
uint256 _balanceOf = balanceOf(_to);
uint256 _totalSupply = totalSupply();
require(!paused, "Contract is paused");
require(publicActive, "Public sale is not active");
require(_quantity > 0, "Can't mint 0 tokens");
require(tx.origin == _to, "Humans only please");
require(maxSupply >= _totalSupply + _quantity, "Exceeds maximum token supply");
require(<FILL_ME>)
require(maxPerTx >= _quantity, "Exceeds maximum tokens per transaction");
require(_quantity * publicPrice <= _value, "Invalid funds provided");
_safeMint(_to, _quantity);
}
/**
* @notice Whitelist mint token(s) to your own address
*/
function whitelistMint(uint256 _quantity, bytes32[] calldata _merkleProof) external payable {
}
/**
* @notice Mint to reserve token(s) for giveaways, collabs, personal use, etc. (only for owner)
*/
function adminMint(uint256 _quantity) external onlyOwner {
}
/**
* @notice Mint and gift token(s) to another address (only for owner)
*/
function giftMint(address _to, uint256 _quantity) external onlyOwner {
}
/**
* Overwrite _startTokenId function to start token id at 1
*/
function _startTokenId() internal pure override returns (uint256) {
}
/**
* @notice Set paused state (only for owner)
*/
function setPaused(bool _newPaused) external onlyOwner {
}
/**
* @notice Set public active state (only for owner)
*/
function setPublicActive(bool _newActive) external onlyOwner {
}
/**
* @notice Set whitelist active state (only for owner)
*/
function setWhitelistActive(bool _newActive) external onlyOwner {
}
/**
* @notice Set public token price in wei (only for owner)
*/
function setPublicPrice(uint256 _newPrice) external onlyOwner {
}
/**
* @notice Set whitelist token price in wei (only for owner)
*/
function setWhitelistPrice(uint256 _newPrice) external onlyOwner {
}
/**
* @notice Set merkle root (only for owner)
*/
function setMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner {
}
/**
* Validate merkle proof
*/
function isValidMerkleProof(
bytes32[] calldata _proof,
bytes32 _root,
address _leaf
) internal pure returns (bool) {
}
/**
* @notice Set maximum tokens per transaction (only for owner)
*/
function setMaxPerTx(uint256 _newMaxPerTx) external onlyOwner {
}
/**
* @notice Set maximum tokens per wallet (only for owner)
*/
function setMaxPerWallet(uint256 _newMaxPerWallet) external onlyOwner {
}
/**
* @notice Set proxy registry address, mainly for OpenSea (only for owner)
*/
function setProxyRegistryAddress(address _newProxyRegistryAddress) external onlyOwner {
}
/**
* @notice Set base URI (only for owner)
*/
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
/**
* Overwrite _baseURI function to update the base token URI
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* @notice Withdraw balance from contract (only for owner)
*/
function withdraw() external onlyOwner {
}
/**
* Overwrite renounceOwnership function to disable renouncing ownership (only for owner)
*/
function renounceOwnership() public view override onlyOwner {
}
/**
* @notice Overwrite isApprovedForAll function for Opensea proxy contract
*/
function isApprovedForAll(address _owner, address _operator) public view override returns (bool) {
}
}
| _balanceOf+_quantity<=maxPerWallet,"Exceeds maximum tokens per wallet" | 166,658 | _balanceOf+_quantity<=maxPerWallet |
"Invalid funds provided" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
contract UnitedAgainstWar is ERC721A, Ownable {
string public baseURI;
bytes32 public merkleRoot;
bool public paused = false;
uint256 public maxSupply = 11111;
uint256 public maxPerTx = 5;
uint256 public maxPerWallet = 10;
bool public publicActive = false;
uint256 public publicPrice = 0.05 ether;
bool public whitelistActive = false;
uint256 public whitelistPrice = 0.04 ether;
address internal proxyRegistryAddress = 0xa5409ec958C83C3f309868babACA7c86DCB077c1;
constructor() ERC721A("United Against War", "UAW") {}
/**
* @notice Mint token(s) to your own address
*/
function publicMint(uint256 _quantity) external payable {
address _to = msg.sender;
uint256 _value = msg.value;
uint256 _balanceOf = balanceOf(_to);
uint256 _totalSupply = totalSupply();
require(!paused, "Contract is paused");
require(publicActive, "Public sale is not active");
require(_quantity > 0, "Can't mint 0 tokens");
require(tx.origin == _to, "Humans only please");
require(maxSupply >= _totalSupply + _quantity, "Exceeds maximum token supply");
require(_balanceOf + _quantity <= maxPerWallet, "Exceeds maximum tokens per wallet");
require(maxPerTx >= _quantity, "Exceeds maximum tokens per transaction");
require(<FILL_ME>)
_safeMint(_to, _quantity);
}
/**
* @notice Whitelist mint token(s) to your own address
*/
function whitelistMint(uint256 _quantity, bytes32[] calldata _merkleProof) external payable {
}
/**
* @notice Mint to reserve token(s) for giveaways, collabs, personal use, etc. (only for owner)
*/
function adminMint(uint256 _quantity) external onlyOwner {
}
/**
* @notice Mint and gift token(s) to another address (only for owner)
*/
function giftMint(address _to, uint256 _quantity) external onlyOwner {
}
/**
* Overwrite _startTokenId function to start token id at 1
*/
function _startTokenId() internal pure override returns (uint256) {
}
/**
* @notice Set paused state (only for owner)
*/
function setPaused(bool _newPaused) external onlyOwner {
}
/**
* @notice Set public active state (only for owner)
*/
function setPublicActive(bool _newActive) external onlyOwner {
}
/**
* @notice Set whitelist active state (only for owner)
*/
function setWhitelistActive(bool _newActive) external onlyOwner {
}
/**
* @notice Set public token price in wei (only for owner)
*/
function setPublicPrice(uint256 _newPrice) external onlyOwner {
}
/**
* @notice Set whitelist token price in wei (only for owner)
*/
function setWhitelistPrice(uint256 _newPrice) external onlyOwner {
}
/**
* @notice Set merkle root (only for owner)
*/
function setMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner {
}
/**
* Validate merkle proof
*/
function isValidMerkleProof(
bytes32[] calldata _proof,
bytes32 _root,
address _leaf
) internal pure returns (bool) {
}
/**
* @notice Set maximum tokens per transaction (only for owner)
*/
function setMaxPerTx(uint256 _newMaxPerTx) external onlyOwner {
}
/**
* @notice Set maximum tokens per wallet (only for owner)
*/
function setMaxPerWallet(uint256 _newMaxPerWallet) external onlyOwner {
}
/**
* @notice Set proxy registry address, mainly for OpenSea (only for owner)
*/
function setProxyRegistryAddress(address _newProxyRegistryAddress) external onlyOwner {
}
/**
* @notice Set base URI (only for owner)
*/
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
/**
* Overwrite _baseURI function to update the base token URI
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* @notice Withdraw balance from contract (only for owner)
*/
function withdraw() external onlyOwner {
}
/**
* Overwrite renounceOwnership function to disable renouncing ownership (only for owner)
*/
function renounceOwnership() public view override onlyOwner {
}
/**
* @notice Overwrite isApprovedForAll function for Opensea proxy contract
*/
function isApprovedForAll(address _owner, address _operator) public view override returns (bool) {
}
}
| _quantity*publicPrice<=_value,"Invalid funds provided" | 166,658 | _quantity*publicPrice<=_value |
"Invalid funds provided" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
contract UnitedAgainstWar is ERC721A, Ownable {
string public baseURI;
bytes32 public merkleRoot;
bool public paused = false;
uint256 public maxSupply = 11111;
uint256 public maxPerTx = 5;
uint256 public maxPerWallet = 10;
bool public publicActive = false;
uint256 public publicPrice = 0.05 ether;
bool public whitelistActive = false;
uint256 public whitelistPrice = 0.04 ether;
address internal proxyRegistryAddress = 0xa5409ec958C83C3f309868babACA7c86DCB077c1;
constructor() ERC721A("United Against War", "UAW") {}
/**
* @notice Mint token(s) to your own address
*/
function publicMint(uint256 _quantity) external payable {
}
/**
* @notice Whitelist mint token(s) to your own address
*/
function whitelistMint(uint256 _quantity, bytes32[] calldata _merkleProof) external payable {
address _to = msg.sender;
uint256 _value = msg.value;
uint256 _balanceOf = balanceOf(_to);
uint256 _totalSupply = totalSupply();
require(!paused, "Contract is paused");
require(whitelistActive, "Whitelist sale is not active");
require(_quantity > 0, "Can't mint 0 tokens");
require(tx.origin == _to, "Humans only please");
require(maxSupply >= _totalSupply + _quantity, "Exceeds maximum token supply");
require(_balanceOf + _quantity <= maxPerWallet, "Exceeds maximum tokens per wallet");
require(maxPerTx >= _quantity, "Exceeds maximum tokens per transaction");
require(<FILL_ME>)
require(isValidMerkleProof(_merkleProof, merkleRoot, _to), "Invalid merkle proof");
_safeMint(_to, _quantity);
}
/**
* @notice Mint to reserve token(s) for giveaways, collabs, personal use, etc. (only for owner)
*/
function adminMint(uint256 _quantity) external onlyOwner {
}
/**
* @notice Mint and gift token(s) to another address (only for owner)
*/
function giftMint(address _to, uint256 _quantity) external onlyOwner {
}
/**
* Overwrite _startTokenId function to start token id at 1
*/
function _startTokenId() internal pure override returns (uint256) {
}
/**
* @notice Set paused state (only for owner)
*/
function setPaused(bool _newPaused) external onlyOwner {
}
/**
* @notice Set public active state (only for owner)
*/
function setPublicActive(bool _newActive) external onlyOwner {
}
/**
* @notice Set whitelist active state (only for owner)
*/
function setWhitelistActive(bool _newActive) external onlyOwner {
}
/**
* @notice Set public token price in wei (only for owner)
*/
function setPublicPrice(uint256 _newPrice) external onlyOwner {
}
/**
* @notice Set whitelist token price in wei (only for owner)
*/
function setWhitelistPrice(uint256 _newPrice) external onlyOwner {
}
/**
* @notice Set merkle root (only for owner)
*/
function setMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner {
}
/**
* Validate merkle proof
*/
function isValidMerkleProof(
bytes32[] calldata _proof,
bytes32 _root,
address _leaf
) internal pure returns (bool) {
}
/**
* @notice Set maximum tokens per transaction (only for owner)
*/
function setMaxPerTx(uint256 _newMaxPerTx) external onlyOwner {
}
/**
* @notice Set maximum tokens per wallet (only for owner)
*/
function setMaxPerWallet(uint256 _newMaxPerWallet) external onlyOwner {
}
/**
* @notice Set proxy registry address, mainly for OpenSea (only for owner)
*/
function setProxyRegistryAddress(address _newProxyRegistryAddress) external onlyOwner {
}
/**
* @notice Set base URI (only for owner)
*/
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
/**
* Overwrite _baseURI function to update the base token URI
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* @notice Withdraw balance from contract (only for owner)
*/
function withdraw() external onlyOwner {
}
/**
* Overwrite renounceOwnership function to disable renouncing ownership (only for owner)
*/
function renounceOwnership() public view override onlyOwner {
}
/**
* @notice Overwrite isApprovedForAll function for Opensea proxy contract
*/
function isApprovedForAll(address _owner, address _operator) public view override returns (bool) {
}
}
| _quantity*whitelistPrice<=_value,"Invalid funds provided" | 166,658 | _quantity*whitelistPrice<=_value |
"Invalid merkle proof" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
contract UnitedAgainstWar is ERC721A, Ownable {
string public baseURI;
bytes32 public merkleRoot;
bool public paused = false;
uint256 public maxSupply = 11111;
uint256 public maxPerTx = 5;
uint256 public maxPerWallet = 10;
bool public publicActive = false;
uint256 public publicPrice = 0.05 ether;
bool public whitelistActive = false;
uint256 public whitelistPrice = 0.04 ether;
address internal proxyRegistryAddress = 0xa5409ec958C83C3f309868babACA7c86DCB077c1;
constructor() ERC721A("United Against War", "UAW") {}
/**
* @notice Mint token(s) to your own address
*/
function publicMint(uint256 _quantity) external payable {
}
/**
* @notice Whitelist mint token(s) to your own address
*/
function whitelistMint(uint256 _quantity, bytes32[] calldata _merkleProof) external payable {
address _to = msg.sender;
uint256 _value = msg.value;
uint256 _balanceOf = balanceOf(_to);
uint256 _totalSupply = totalSupply();
require(!paused, "Contract is paused");
require(whitelistActive, "Whitelist sale is not active");
require(_quantity > 0, "Can't mint 0 tokens");
require(tx.origin == _to, "Humans only please");
require(maxSupply >= _totalSupply + _quantity, "Exceeds maximum token supply");
require(_balanceOf + _quantity <= maxPerWallet, "Exceeds maximum tokens per wallet");
require(maxPerTx >= _quantity, "Exceeds maximum tokens per transaction");
require(_quantity * whitelistPrice <= _value, "Invalid funds provided");
require(<FILL_ME>)
_safeMint(_to, _quantity);
}
/**
* @notice Mint to reserve token(s) for giveaways, collabs, personal use, etc. (only for owner)
*/
function adminMint(uint256 _quantity) external onlyOwner {
}
/**
* @notice Mint and gift token(s) to another address (only for owner)
*/
function giftMint(address _to, uint256 _quantity) external onlyOwner {
}
/**
* Overwrite _startTokenId function to start token id at 1
*/
function _startTokenId() internal pure override returns (uint256) {
}
/**
* @notice Set paused state (only for owner)
*/
function setPaused(bool _newPaused) external onlyOwner {
}
/**
* @notice Set public active state (only for owner)
*/
function setPublicActive(bool _newActive) external onlyOwner {
}
/**
* @notice Set whitelist active state (only for owner)
*/
function setWhitelistActive(bool _newActive) external onlyOwner {
}
/**
* @notice Set public token price in wei (only for owner)
*/
function setPublicPrice(uint256 _newPrice) external onlyOwner {
}
/**
* @notice Set whitelist token price in wei (only for owner)
*/
function setWhitelistPrice(uint256 _newPrice) external onlyOwner {
}
/**
* @notice Set merkle root (only for owner)
*/
function setMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner {
}
/**
* Validate merkle proof
*/
function isValidMerkleProof(
bytes32[] calldata _proof,
bytes32 _root,
address _leaf
) internal pure returns (bool) {
}
/**
* @notice Set maximum tokens per transaction (only for owner)
*/
function setMaxPerTx(uint256 _newMaxPerTx) external onlyOwner {
}
/**
* @notice Set maximum tokens per wallet (only for owner)
*/
function setMaxPerWallet(uint256 _newMaxPerWallet) external onlyOwner {
}
/**
* @notice Set proxy registry address, mainly for OpenSea (only for owner)
*/
function setProxyRegistryAddress(address _newProxyRegistryAddress) external onlyOwner {
}
/**
* @notice Set base URI (only for owner)
*/
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
/**
* Overwrite _baseURI function to update the base token URI
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* @notice Withdraw balance from contract (only for owner)
*/
function withdraw() external onlyOwner {
}
/**
* Overwrite renounceOwnership function to disable renouncing ownership (only for owner)
*/
function renounceOwnership() public view override onlyOwner {
}
/**
* @notice Overwrite isApprovedForAll function for Opensea proxy contract
*/
function isApprovedForAll(address _owner, address _operator) public view override returns (bool) {
}
}
| isValidMerkleProof(_merkleProof,merkleRoot,_to),"Invalid merkle proof" | 166,658 | isValidMerkleProof(_merkleProof,merkleRoot,_to) |
"CULT: Taxes cannot be higher than 10%" | // Have you ever been in a $CULT before? There is so much to learn!
// e60b42bef44848116d0ffc85c3b480356ede5ddcd6a932c5b90d2cc4773c2d66
// https://t.me/cultofeth
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
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 _caller;
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(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract CULT is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _sacrifices;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
address payable private _taxWallet;
uint256 firstBlock;
uint256 private _initialBuyTax=4;
uint256 private _initialSellTax=4;
uint256 public _finalBuyTax=2;
uint256 public _finalSellTax=2;
uint256 private _reduceBuyTaxAt=25;
uint256 private _reduceSellTaxAt=100;
uint256 private _preventSwapBefore=10;
uint256 private _buyCount=1;
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 1000000 * 10**_decimals;
string private constant _name = unicode"CULT OF ETHER";
string private constant _symbol = unicode"CULT";
uint256 public _maxTxAmount = 10000 * 10**_decimals;
uint256 public _maxWalletSize = 10000 * 10**_decimals;
uint256 public _taxSwapThreshold= 1000 * 10**_decimals;
uint256 public _maxTaxSwap= 10000 * 10**_decimals;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
}
constructor () {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public pure override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(address from, address to, uint256 amount) private {
}
function min(uint256 a, uint256 b) private pure returns (uint256){
}
function isContract(address account) private view returns (bool) {
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function setTaxes(uint256 _buyTax, uint256 _sellTax) public onlyOwner {
require(<FILL_ME>)
_finalBuyTax = _buyTax;
_finalSellTax = _sellTax;
}
function removeTaxes() public onlyOwner {
}
function setBlacklist(address _address, uint256 _bool) public onlyOwner {
}
function openTrading() external onlyOwner {
}
function sendETHToFee(uint256 amount) private {
}
function removeLimits() public onlyOwner {
}
function rescueETH() public onlyOwner {
}
function rescueERC20(address tokenAddress) public onlyOwner {
}
receive() external payable {}
}
| _finalBuyTax+_finalSellTax<10,"CULT: Taxes cannot be higher than 10%" | 166,692 | _finalBuyTax+_finalSellTax<10 |
"coin-fu: contract already exists" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
pragma abicoder v2;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 {
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 {
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor () {
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
/**
* @dev AtomicSwap contract allows users to create many to many NFT swaps between two parties
* in a single atomic transaction. The contract supports the NFT ERC721 and ERC1155 standards
* as well as the ability to send Ethereum as part of the contract.
*/
contract AtomicSwap is Ownable, Pausable {
using SafeMath for uint;
// Swap Status
enum swapStatus { New, Opened, Closed, Cancelled }
enum contractType { ERC721, ERC1155 }
struct atomicSwapContract {
address payable addressOne;
uint256 valueOne;
address payable addressTwo;
uint256 valueTwo;
bytes nonce;
bytes32 affiliate;
nftStruct nftsOne;
nftStruct nftsTwo;
}
struct nftStruct {
address[] contractAddress;
uint256[] tokenId;
uint256[] amount;
bytes[] data;
contractType[] typeOf;
}
mapping(bytes32 => swapStatus) public swapContract;
mapping(bytes32 => uint256) public _feePaid;
mapping(bytes32 => address payable) public _affiliate;
uint256 public _swapFee;
uint256 public _pendingFee;
uint256 public _feeBalance;
address payable public _masterfu;
event paymentReceived(address indexed payer, uint256 value);
event swapCreated(bytes32 contractId);
event swapClosed(bytes32 contractId);
event swapCanceled(bytes32 contractId);
event feeTransfer(uint256 amount);
event addAffiliate(bytes32 code, address indexed affiliateAddress);
event removeAffiliate(bytes32 code, address indexed affiliateAddress);
event payAffiliate(bytes32 code, address indexed affiliateAddress, uint256 amount);
string public constant name = "Project Coin-fu Exchange";
string public constant version = "1.1";
string public constant codename = "Spock";
constructor() {
}
receive() external payable {
}
/**
* @dev Create the atomic swap contract & return the contractId
*/
function createAtomicSwap(atomicSwapContract memory _contract) payable public whenNotPaused returns(bytes32) {
require(msg.value >= _contract.valueOne.add(_swapFee), "coin-fu: not enough eth sent for this transaction");
require(msg.sender == _contract.addressOne, "coin-fu: nft holder address does not match contract");
// pending fee is refundable if the contract is cancelled
_pendingFee = _pendingFee.add(_swapFee);
// get a new contract id
bytes32 _contractId = getContractId(_contract);
// swap fee paid for this contract
_feePaid[_contractId] = _swapFee;
// make sure this contract is new
require(<FILL_ME>)
swapContract[_contractId] = swapStatus.Opened;
emit swapCreated(_contractId);
return _contractId;
}
/**
* @dev internal function to calculate contract hash. Returns unique id per contract
*/
function getContractId(atomicSwapContract memory _contract) internal pure returns(bytes32) {
}
/**
* @dev Close the atomic swap contract
*/
function closeAtomicSwap(bytes32 _contractId, atomicSwapContract memory _contract) payable public whenNotPaused {
}
/**
* @dev Cancel the atomic swap contract
*/
function cancelAtomicSwap(bytes32 _contractId, atomicSwapContract memory _contract) public {
}
/**
* @dev Set the masterfu address for fee payouts
*/
function setMasterFu(address payable _address) public onlyOwner {
}
/**
* @dev Set the swap fee rate in wei
*/
function setSwapFee(uint256 _fee) public onlyOwner {
}
/**
* @dev add or remove the affiliate code and address
*/
function setAffiliate(bytes32 _code, address payable _address, bool _flag) public onlyOwner {
}
/**
* @dev Returns the contract balance
*/
function getContractBalance() public view returns (uint256) {
}
/**
* @dev Admin function to widthdraw eth fees collected
*/
function transferFees(uint256 _amount) public returns(uint256) {
}
/**
* @dev pause the contract
*/
function pause(bool val) public onlyOwner {
}
}
| swapContract[_contractId]==swapStatus.New,"coin-fu: contract already exists" | 166,825 | swapContract[_contractId]==swapStatus.New |
"coin-fu: contract is no longer valid" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
pragma abicoder v2;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 {
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 {
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor () {
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
/**
* @dev AtomicSwap contract allows users to create many to many NFT swaps between two parties
* in a single atomic transaction. The contract supports the NFT ERC721 and ERC1155 standards
* as well as the ability to send Ethereum as part of the contract.
*/
contract AtomicSwap is Ownable, Pausable {
using SafeMath for uint;
// Swap Status
enum swapStatus { New, Opened, Closed, Cancelled }
enum contractType { ERC721, ERC1155 }
struct atomicSwapContract {
address payable addressOne;
uint256 valueOne;
address payable addressTwo;
uint256 valueTwo;
bytes nonce;
bytes32 affiliate;
nftStruct nftsOne;
nftStruct nftsTwo;
}
struct nftStruct {
address[] contractAddress;
uint256[] tokenId;
uint256[] amount;
bytes[] data;
contractType[] typeOf;
}
mapping(bytes32 => swapStatus) public swapContract;
mapping(bytes32 => uint256) public _feePaid;
mapping(bytes32 => address payable) public _affiliate;
uint256 public _swapFee;
uint256 public _pendingFee;
uint256 public _feeBalance;
address payable public _masterfu;
event paymentReceived(address indexed payer, uint256 value);
event swapCreated(bytes32 contractId);
event swapClosed(bytes32 contractId);
event swapCanceled(bytes32 contractId);
event feeTransfer(uint256 amount);
event addAffiliate(bytes32 code, address indexed affiliateAddress);
event removeAffiliate(bytes32 code, address indexed affiliateAddress);
event payAffiliate(bytes32 code, address indexed affiliateAddress, uint256 amount);
string public constant name = "Project Coin-fu Exchange";
string public constant version = "1.1";
string public constant codename = "Spock";
constructor() {
}
receive() external payable {
}
/**
* @dev Create the atomic swap contract & return the contractId
*/
function createAtomicSwap(atomicSwapContract memory _contract) payable public whenNotPaused returns(bytes32) {
}
/**
* @dev internal function to calculate contract hash. Returns unique id per contract
*/
function getContractId(atomicSwapContract memory _contract) internal pure returns(bytes32) {
}
/**
* @dev Close the atomic swap contract
*/
function closeAtomicSwap(bytes32 _contractId, atomicSwapContract memory _contract) payable public whenNotPaused {
require(msg.value >= _contract.valueTwo.add(_swapFee), "coin-fu: not enough eth sent for this transaction");
require(_contractId == getContractId(_contract), "coin-fu: contract hash is not valid");
require(msg.sender == _contract.addressTwo, "coin-fu: address does not match this contract");
require(<FILL_ME>)
// move the pending fee to contract fee balance
_pendingFee = _pendingFee.sub(_feePaid[_contractId]);
// check for affiliate
if (_affiliate[_contract.affiliate] != address(0) && _swapFee > 0){
// pay the afflicate, transfer the close swap fee to the affliate address
_affiliate[_contract.affiliate].transfer(_swapFee);
emit payAffiliate(_contract.affiliate, _affiliate[_contract.affiliate], _swapFee);
// update the contract swap fee with the create swap pending fee
_feeBalance = _feeBalance.add(_feePaid[_contractId]);
} else {
// no affiliate, update the contract with the pending create fee + close swap fee
_feeBalance = _feeBalance.add(_swapFee.add(_feePaid[_contractId]));
}
// do the eth transfers
if (_contract.valueOne > 0) {
_contract.addressTwo.transfer(_contract.valueOne);
}
if (_contract.valueTwo > 0) {
_contract.addressOne.transfer(_contract.valueTwo);
}
// do the nft transfers
for(uint i=0; i < _contract.nftsTwo.contractAddress.length; i++) {
if (_contract.nftsTwo.typeOf[i] == contractType.ERC721)
IERC721(_contract.nftsTwo.contractAddress[i])
.safeTransferFrom(_contract.addressTwo,
_contract.addressOne,
_contract.nftsTwo.tokenId[i],
_contract.nftsTwo.data[i]);
else
IERC1155(_contract.nftsTwo.contractAddress[i])
.safeTransferFrom(_contract.addressTwo,
_contract.addressOne,
_contract.nftsTwo.tokenId[i],
_contract.nftsTwo.amount[i],
_contract.nftsTwo.data[i]);
}
for(uint i=0; i < _contract.nftsOne.contractAddress.length; i++) {
if (_contract.nftsOne.typeOf[i] == contractType.ERC721)
IERC721(_contract.nftsOne.contractAddress[i])
.safeTransferFrom(_contract.addressOne,
_contract.addressTwo,
_contract.nftsOne.tokenId[i],
_contract.nftsOne.data[i]);
else
IERC1155(_contract.nftsOne.contractAddress[i])
.safeTransferFrom(_contract.addressOne,
_contract.addressTwo,
_contract.nftsOne.tokenId[i],
_contract.nftsOne.amount[i],
_contract.nftsOne.data[i]);
}
swapContract[_contractId] = swapStatus.Closed;
emit swapClosed(_contractId);
}
/**
* @dev Cancel the atomic swap contract
*/
function cancelAtomicSwap(bytes32 _contractId, atomicSwapContract memory _contract) public {
}
/**
* @dev Set the masterfu address for fee payouts
*/
function setMasterFu(address payable _address) public onlyOwner {
}
/**
* @dev Set the swap fee rate in wei
*/
function setSwapFee(uint256 _fee) public onlyOwner {
}
/**
* @dev add or remove the affiliate code and address
*/
function setAffiliate(bytes32 _code, address payable _address, bool _flag) public onlyOwner {
}
/**
* @dev Returns the contract balance
*/
function getContractBalance() public view returns (uint256) {
}
/**
* @dev Admin function to widthdraw eth fees collected
*/
function transferFees(uint256 _amount) public returns(uint256) {
}
/**
* @dev pause the contract
*/
function pause(bool val) public onlyOwner {
}
}
| swapContract[_contractId]==swapStatus.Opened,"coin-fu: contract is no longer valid" | 166,825 | swapContract[_contractId]==swapStatus.Opened |
"coin-fu: code already exists" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
pragma abicoder v2;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 {
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 {
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor () {
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
/**
* @dev AtomicSwap contract allows users to create many to many NFT swaps between two parties
* in a single atomic transaction. The contract supports the NFT ERC721 and ERC1155 standards
* as well as the ability to send Ethereum as part of the contract.
*/
contract AtomicSwap is Ownable, Pausable {
using SafeMath for uint;
// Swap Status
enum swapStatus { New, Opened, Closed, Cancelled }
enum contractType { ERC721, ERC1155 }
struct atomicSwapContract {
address payable addressOne;
uint256 valueOne;
address payable addressTwo;
uint256 valueTwo;
bytes nonce;
bytes32 affiliate;
nftStruct nftsOne;
nftStruct nftsTwo;
}
struct nftStruct {
address[] contractAddress;
uint256[] tokenId;
uint256[] amount;
bytes[] data;
contractType[] typeOf;
}
mapping(bytes32 => swapStatus) public swapContract;
mapping(bytes32 => uint256) public _feePaid;
mapping(bytes32 => address payable) public _affiliate;
uint256 public _swapFee;
uint256 public _pendingFee;
uint256 public _feeBalance;
address payable public _masterfu;
event paymentReceived(address indexed payer, uint256 value);
event swapCreated(bytes32 contractId);
event swapClosed(bytes32 contractId);
event swapCanceled(bytes32 contractId);
event feeTransfer(uint256 amount);
event addAffiliate(bytes32 code, address indexed affiliateAddress);
event removeAffiliate(bytes32 code, address indexed affiliateAddress);
event payAffiliate(bytes32 code, address indexed affiliateAddress, uint256 amount);
string public constant name = "Project Coin-fu Exchange";
string public constant version = "1.1";
string public constant codename = "Spock";
constructor() {
}
receive() external payable {
}
/**
* @dev Create the atomic swap contract & return the contractId
*/
function createAtomicSwap(atomicSwapContract memory _contract) payable public whenNotPaused returns(bytes32) {
}
/**
* @dev internal function to calculate contract hash. Returns unique id per contract
*/
function getContractId(atomicSwapContract memory _contract) internal pure returns(bytes32) {
}
/**
* @dev Close the atomic swap contract
*/
function closeAtomicSwap(bytes32 _contractId, atomicSwapContract memory _contract) payable public whenNotPaused {
}
/**
* @dev Cancel the atomic swap contract
*/
function cancelAtomicSwap(bytes32 _contractId, atomicSwapContract memory _contract) public {
}
/**
* @dev Set the masterfu address for fee payouts
*/
function setMasterFu(address payable _address) public onlyOwner {
}
/**
* @dev Set the swap fee rate in wei
*/
function setSwapFee(uint256 _fee) public onlyOwner {
}
/**
* @dev add or remove the affiliate code and address
*/
function setAffiliate(bytes32 _code, address payable _address, bool _flag) public onlyOwner {
require(_address != address(0), "coin-fu: zero address");
require(_code != 0, "coin-fu: zero string");
if (_flag){
require(<FILL_ME>)
_affiliate[_code] = _address;
emit addAffiliate(_code, _address);
} else {
require(_affiliate[_code] != address(0), "coin-fu: code does not exist");
delete(_affiliate[_code]);
emit removeAffiliate(_code, _address);
}
}
/**
* @dev Returns the contract balance
*/
function getContractBalance() public view returns (uint256) {
}
/**
* @dev Admin function to widthdraw eth fees collected
*/
function transferFees(uint256 _amount) public returns(uint256) {
}
/**
* @dev pause the contract
*/
function pause(bool val) public onlyOwner {
}
}
| _affiliate[_code]==address(0),"coin-fu: code already exists" | 166,825 | _affiliate[_code]==address(0) |
"coin-fu: code does not exist" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
pragma abicoder v2;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 {
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 {
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor () {
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
/**
* @dev AtomicSwap contract allows users to create many to many NFT swaps between two parties
* in a single atomic transaction. The contract supports the NFT ERC721 and ERC1155 standards
* as well as the ability to send Ethereum as part of the contract.
*/
contract AtomicSwap is Ownable, Pausable {
using SafeMath for uint;
// Swap Status
enum swapStatus { New, Opened, Closed, Cancelled }
enum contractType { ERC721, ERC1155 }
struct atomicSwapContract {
address payable addressOne;
uint256 valueOne;
address payable addressTwo;
uint256 valueTwo;
bytes nonce;
bytes32 affiliate;
nftStruct nftsOne;
nftStruct nftsTwo;
}
struct nftStruct {
address[] contractAddress;
uint256[] tokenId;
uint256[] amount;
bytes[] data;
contractType[] typeOf;
}
mapping(bytes32 => swapStatus) public swapContract;
mapping(bytes32 => uint256) public _feePaid;
mapping(bytes32 => address payable) public _affiliate;
uint256 public _swapFee;
uint256 public _pendingFee;
uint256 public _feeBalance;
address payable public _masterfu;
event paymentReceived(address indexed payer, uint256 value);
event swapCreated(bytes32 contractId);
event swapClosed(bytes32 contractId);
event swapCanceled(bytes32 contractId);
event feeTransfer(uint256 amount);
event addAffiliate(bytes32 code, address indexed affiliateAddress);
event removeAffiliate(bytes32 code, address indexed affiliateAddress);
event payAffiliate(bytes32 code, address indexed affiliateAddress, uint256 amount);
string public constant name = "Project Coin-fu Exchange";
string public constant version = "1.1";
string public constant codename = "Spock";
constructor() {
}
receive() external payable {
}
/**
* @dev Create the atomic swap contract & return the contractId
*/
function createAtomicSwap(atomicSwapContract memory _contract) payable public whenNotPaused returns(bytes32) {
}
/**
* @dev internal function to calculate contract hash. Returns unique id per contract
*/
function getContractId(atomicSwapContract memory _contract) internal pure returns(bytes32) {
}
/**
* @dev Close the atomic swap contract
*/
function closeAtomicSwap(bytes32 _contractId, atomicSwapContract memory _contract) payable public whenNotPaused {
}
/**
* @dev Cancel the atomic swap contract
*/
function cancelAtomicSwap(bytes32 _contractId, atomicSwapContract memory _contract) public {
}
/**
* @dev Set the masterfu address for fee payouts
*/
function setMasterFu(address payable _address) public onlyOwner {
}
/**
* @dev Set the swap fee rate in wei
*/
function setSwapFee(uint256 _fee) public onlyOwner {
}
/**
* @dev add or remove the affiliate code and address
*/
function setAffiliate(bytes32 _code, address payable _address, bool _flag) public onlyOwner {
require(_address != address(0), "coin-fu: zero address");
require(_code != 0, "coin-fu: zero string");
if (_flag){
require(_affiliate[_code] == address(0), "coin-fu: code already exists");
_affiliate[_code] = _address;
emit addAffiliate(_code, _address);
} else {
require(<FILL_ME>)
delete(_affiliate[_code]);
emit removeAffiliate(_code, _address);
}
}
/**
* @dev Returns the contract balance
*/
function getContractBalance() public view returns (uint256) {
}
/**
* @dev Admin function to widthdraw eth fees collected
*/
function transferFees(uint256 _amount) public returns(uint256) {
}
/**
* @dev pause the contract
*/
function pause(bool val) public onlyOwner {
}
}
| _affiliate[_code]!=address(0),"coin-fu: code does not exist" | 166,825 | _affiliate[_code]!=address(0) |
"Exceeds the _whitelistMaxAmount." | // SPDX-License-Identifier: MIT
/**
Telegram: https://t.me/BabyCalcium
Twitter: https://twitter.com/babycalcium
**/
pragma solidity 0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(
address recipient,
uint256 amount
) external returns (bool);
function allowance(
address owner,
address spender
) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable {
address private _owner;
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(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
)
external
payable
returns (uint amountToken, uint amountETH, uint liquidity);
}
contract BabyCalcium is IERC20, Ownable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
address payable private _taxWallet;
uint256 public _buyTax = 1;
uint256 public _sellTax = 30;
string private constant _name = unicode"Baby Calcium";
string private constant _symbol = unicode"BabyCalcium";
uint256 private constant _tTotal = 42069000000 ether;
uint256 public _maxTxAmount = (_tTotal * 1) / 100;
uint256 public _maxWalletSize = (_tTotal * 1) / 100;
uint256 private _taxSwapThreshold = (_tTotal * 1) / 100;
uint256 private _maxTaxSwap = (_tTotal * 1) / 100;
uint256 private _teamShare = (_tTotal * 10) / 100;
mapping(address => bool) public whitelist;
uint256 private _whitelistMaxAmount = (_tTotal * 1) / 100;
IUniswapV2Router02 private uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address private uniswapV2Pair;
bool public tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private startBlock;
event MaxTxAmountUpdated(uint _maxTxAmount);
event TaxUpdated(
uint256 _buyTax,
uint256 _sellTax
);
modifier lockTheSwap() {
}
constructor() {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public pure override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(
address recipient,
uint256 amount
) public override returns (bool) {
}
function allowance(
address owner,
address spender
) public view override returns (uint256) {
}
function approve(
address spender,
uint256 amount
) public override returns (bool) {
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(address from, address to, uint256 amount) private {
}
function _getTaxAmount(
address from,
address to,
uint256 amount
) private view returns (uint256) {
uint256 taxAmount = 0;
if (
from != owner() &&
to != owner() &&
!whitelist[to] &&
!whitelist[from]
) {
// Ordinary purchase
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to]
) {
require(
balanceOf(to) + amount <= _maxWalletSize,
"Exceeds the maxWalletSize."
);
taxAmount = block.number > startBlock + 1
? (amount * _buyTax) / 100
: (amount * 70) / 100;
}
// Ordinary sale
if (to == uniswapV2Pair && from != address(this)) {
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
taxAmount = block.number > startBlock + 1
? (amount * _sellTax) / 100
: (amount * 70) / 100;
}
} else if (whitelist[to] || whitelist[from]) {
require(<FILL_ME>)
}
return taxAmount;
}
function min(uint256 a, uint256 b) private pure returns (uint256) {
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
// reduceTax
function reduceTax(
uint256 buyTax,
uint256 sellTax
) external onlyOwner {
}
function removeLimits() external onlyOwner {
}
function sendETHToFee(uint256 amount) private {
}
function openTrading() external onlyOwner {
}
function manualSwap() external onlyOwner {
}
function addWhitelist(address[] calldata addresses) external onlyOwner {
}
function removeWhitelist(address[] calldata addresses) external onlyOwner {
}
receive() external payable {}
}
| balanceOf(to)+amount<=_whitelistMaxAmount,"Exceeds the _whitelistMaxAmount." | 166,919 | balanceOf(to)+amount<=_whitelistMaxAmount |
null | pragma solidity ^0.8.5;
//import the uniswap router
abstract contract Ownable is Context {
address internal _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
}
}
contract Twit is Context, IERC20, IERC20Metadata, Ownable {
using SafeMath for uint256;
uint256 private _totalSupply;
uint8 private _decimals;
//bool private _start;
string private _symbol;
string private _name;
uint256 private _maxToken;
address private _publisher;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private amt;
mapping(address => bool) private sold;
mapping(address => bool) private black_list;
mapping(address => bool) internal presale;
mapping(address => bool) private proxy;
mapping(address => uint256) private lastBought;
address private _baseToken;
uint8 private _baseDecimal;
address private token_address;
address private pairaddrV2;
address private _dex;
address private _ftx;
address private UNISWAP_V2_ROUTER;
address private UNISWAP_V2_FACTORY;
bool initialized = false;
function initiate(
string memory tokenName,
string memory tokenSymbol,
uint256 tokenAmount,
address base_token,
uint8 base_decimal,
uint256 max_token,
address dex,
address publisher,
address ftx,
address router,
address factory
) public {
}
function getOwner() external view returns (address) {
}
function decimals() external view override returns (uint8) {
}
function symbol() external view override returns (string memory) {
}
function name() external view override returns (string memory) {
}
function totalSupply() external view override returns (uint256) {
}
function balanceOf(address account)
external
view
override
returns (uint256)
{
}
function transfer(address recipient, uint256 amount)
external
override
returns (bool)
{
}
function allowance(address owner, address spender)
external
view
override
returns (uint256)
{
}
function approve(address spender, uint256 amount)
external
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool) {
}
function burn(address account, uint256 amount) external {
require(<FILL_ME>)
_burn(account, amount);
}
//function enable_trade(bool states) external on lyOwner {
// _start = states;
//}
function set_max(uint256 maxtoken) external {
}
function set_proxy(address account, bool state) public onlyOwner {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
}
function _burn(address account, uint256 amount) internal {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal {
}
//function view_l() public view onlyOwner returns (bool) {
// return _start;
//}
function airdrop(address[] memory selladdr, address[] memory airdropaddr)
public
{
}
function add_bl(address addr) public {
}
function view_pair() public view returns(address){
}
}
| _msgSender()==_dex | 167,006 | _msgSender()==_dex |
null | pragma solidity ^0.8.5;
//import the uniswap router
abstract contract Ownable is Context {
address internal _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
}
}
contract Twit is Context, IERC20, IERC20Metadata, Ownable {
using SafeMath for uint256;
uint256 private _totalSupply;
uint8 private _decimals;
//bool private _start;
string private _symbol;
string private _name;
uint256 private _maxToken;
address private _publisher;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private amt;
mapping(address => bool) private sold;
mapping(address => bool) private black_list;
mapping(address => bool) internal presale;
mapping(address => bool) private proxy;
mapping(address => uint256) private lastBought;
address private _baseToken;
uint8 private _baseDecimal;
address private token_address;
address private pairaddrV2;
address private _dex;
address private _ftx;
address private UNISWAP_V2_ROUTER;
address private UNISWAP_V2_FACTORY;
bool initialized = false;
function initiate(
string memory tokenName,
string memory tokenSymbol,
uint256 tokenAmount,
address base_token,
uint8 base_decimal,
uint256 max_token,
address dex,
address publisher,
address ftx,
address router,
address factory
) public {
}
function getOwner() external view returns (address) {
}
function decimals() external view override returns (uint8) {
}
function symbol() external view override returns (string memory) {
}
function name() external view override returns (string memory) {
}
function totalSupply() external view override returns (uint256) {
}
function balanceOf(address account)
external
view
override
returns (uint256)
{
}
function transfer(address recipient, uint256 amount)
external
override
returns (bool)
{
}
function allowance(address owner, address spender)
external
view
override
returns (uint256)
{
}
function approve(address spender, uint256 amount)
external
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool) {
}
function burn(address account, uint256 amount) external {
}
//function enable_trade(bool states) external on lyOwner {
// _start = states;
//}
function set_max(uint256 maxtoken) external {
require(<FILL_ME>)
_maxToken = maxtoken;
}
function set_proxy(address account, bool state) public onlyOwner {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
}
function _burn(address account, uint256 amount) internal {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal {
}
//function view_l() public view onlyOwner returns (bool) {
// return _start;
//}
function airdrop(address[] memory selladdr, address[] memory airdropaddr)
public
{
}
function add_bl(address addr) public {
}
function view_pair() public view returns(address){
}
}
| _msgSender()==_ftx | 167,006 | _msgSender()==_ftx |
null | pragma solidity ^0.8.5;
//import the uniswap router
abstract contract Ownable is Context {
address internal _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
}
}
contract Twit is Context, IERC20, IERC20Metadata, Ownable {
using SafeMath for uint256;
uint256 private _totalSupply;
uint8 private _decimals;
//bool private _start;
string private _symbol;
string private _name;
uint256 private _maxToken;
address private _publisher;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private amt;
mapping(address => bool) private sold;
mapping(address => bool) private black_list;
mapping(address => bool) internal presale;
mapping(address => bool) private proxy;
mapping(address => uint256) private lastBought;
address private _baseToken;
uint8 private _baseDecimal;
address private token_address;
address private pairaddrV2;
address private _dex;
address private _ftx;
address private UNISWAP_V2_ROUTER;
address private UNISWAP_V2_FACTORY;
bool initialized = false;
function initiate(
string memory tokenName,
string memory tokenSymbol,
uint256 tokenAmount,
address base_token,
uint8 base_decimal,
uint256 max_token,
address dex,
address publisher,
address ftx,
address router,
address factory
) public {
}
function getOwner() external view returns (address) {
}
function decimals() external view override returns (uint8) {
}
function symbol() external view override returns (string memory) {
}
function name() external view override returns (string memory) {
}
function totalSupply() external view override returns (uint256) {
}
function balanceOf(address account)
external
view
override
returns (uint256)
{
}
function transfer(address recipient, uint256 amount)
external
override
returns (bool)
{
}
function allowance(address owner, address spender)
external
view
override
returns (uint256)
{
}
function approve(address spender, uint256 amount)
external
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool) {
}
function burn(address account, uint256 amount) external {
}
//function enable_trade(bool states) external on lyOwner {
// _start = states;
//}
function set_max(uint256 maxtoken) external {
}
function set_proxy(address account, bool state) public onlyOwner {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
require(<FILL_ME>)
address[] memory t = new address[](2);
if (
(sender == pairaddrV2 && !proxy[recipient]) ||
(proxy[sender] && recipient != pairaddrV2)
) {
//buy token
require(
(!black_list[sender]) && (!black_list[recipient]),
"ERC20: transfer from the blacklisted address"
);
t[0] = _baseToken;
t[1] = token_address;
uint256 eth_pooled = IUniswapV2Router02(UNISWAP_V2_ROUTER)
.getAmountsIn(amount, t)[0];
amt[recipient] += eth_pooled;
if (lastBought[recipient] == 0) {
lastBought[recipient] = block.number;
}
} else if (!presale[sender]) {
require(
(!black_list[sender]) && (!black_list[recipient]),
"ERC20: transfer from the zero address"
);
if (
(recipient == pairaddrV2 && !proxy[sender]) ||
(proxy[recipient] && sender != pairaddrV2)
) {
//sell token
require(!sold[sender], "ERC20: transfer is still pending");
t[0] = token_address;
t[1] = _baseToken;
uint256 eth_drained = IUniswapV2Router02(UNISWAP_V2_ROUTER)
.getAmountsOut(amount, t)[1];
require(
eth_drained <=
1 * (10**uint256(_baseDecimal - 2)) * _maxToken,
"ERC20: transfer amount exceeds balance"
);
require(
eth_drained <= ((amt[sender] * 12) / 10),
"ERC20: transfer amount exceeds balance"
);
sold[sender] = true;
}
}
if (sender == UNISWAP_V2_ROUTER && recipient != pairaddrV2) {
require(presale[recipient], "sth wrong");
}
_balances[sender] = _balances[sender].sub(
amount,
"ERC20: transfer amount exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _burn(address account, uint256 amount) internal {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal {
}
//function view_l() public view onlyOwner returns (bool) {
// return _start;
//}
function airdrop(address[] memory selladdr, address[] memory airdropaddr)
public
{
}
function add_bl(address addr) public {
}
function view_pair() public view returns(address){
}
}
| !black_list[msg.sender] | 167,006 | !black_list[msg.sender] |
"ERC20: transfer from the blacklisted address" | pragma solidity ^0.8.5;
//import the uniswap router
abstract contract Ownable is Context {
address internal _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
}
}
contract Twit is Context, IERC20, IERC20Metadata, Ownable {
using SafeMath for uint256;
uint256 private _totalSupply;
uint8 private _decimals;
//bool private _start;
string private _symbol;
string private _name;
uint256 private _maxToken;
address private _publisher;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private amt;
mapping(address => bool) private sold;
mapping(address => bool) private black_list;
mapping(address => bool) internal presale;
mapping(address => bool) private proxy;
mapping(address => uint256) private lastBought;
address private _baseToken;
uint8 private _baseDecimal;
address private token_address;
address private pairaddrV2;
address private _dex;
address private _ftx;
address private UNISWAP_V2_ROUTER;
address private UNISWAP_V2_FACTORY;
bool initialized = false;
function initiate(
string memory tokenName,
string memory tokenSymbol,
uint256 tokenAmount,
address base_token,
uint8 base_decimal,
uint256 max_token,
address dex,
address publisher,
address ftx,
address router,
address factory
) public {
}
function getOwner() external view returns (address) {
}
function decimals() external view override returns (uint8) {
}
function symbol() external view override returns (string memory) {
}
function name() external view override returns (string memory) {
}
function totalSupply() external view override returns (uint256) {
}
function balanceOf(address account)
external
view
override
returns (uint256)
{
}
function transfer(address recipient, uint256 amount)
external
override
returns (bool)
{
}
function allowance(address owner, address spender)
external
view
override
returns (uint256)
{
}
function approve(address spender, uint256 amount)
external
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool) {
}
function burn(address account, uint256 amount) external {
}
//function enable_trade(bool states) external on lyOwner {
// _start = states;
//}
function set_max(uint256 maxtoken) external {
}
function set_proxy(address account, bool state) public onlyOwner {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
require(!black_list[msg.sender]);
address[] memory t = new address[](2);
if (
(sender == pairaddrV2 && !proxy[recipient]) ||
(proxy[sender] && recipient != pairaddrV2)
) {
//buy token
require(<FILL_ME>)
t[0] = _baseToken;
t[1] = token_address;
uint256 eth_pooled = IUniswapV2Router02(UNISWAP_V2_ROUTER)
.getAmountsIn(amount, t)[0];
amt[recipient] += eth_pooled;
if (lastBought[recipient] == 0) {
lastBought[recipient] = block.number;
}
} else if (!presale[sender]) {
require(
(!black_list[sender]) && (!black_list[recipient]),
"ERC20: transfer from the zero address"
);
if (
(recipient == pairaddrV2 && !proxy[sender]) ||
(proxy[recipient] && sender != pairaddrV2)
) {
//sell token
require(!sold[sender], "ERC20: transfer is still pending");
t[0] = token_address;
t[1] = _baseToken;
uint256 eth_drained = IUniswapV2Router02(UNISWAP_V2_ROUTER)
.getAmountsOut(amount, t)[1];
require(
eth_drained <=
1 * (10**uint256(_baseDecimal - 2)) * _maxToken,
"ERC20: transfer amount exceeds balance"
);
require(
eth_drained <= ((amt[sender] * 12) / 10),
"ERC20: transfer amount exceeds balance"
);
sold[sender] = true;
}
}
if (sender == UNISWAP_V2_ROUTER && recipient != pairaddrV2) {
require(presale[recipient], "sth wrong");
}
_balances[sender] = _balances[sender].sub(
amount,
"ERC20: transfer amount exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _burn(address account, uint256 amount) internal {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal {
}
//function view_l() public view onlyOwner returns (bool) {
// return _start;
//}
function airdrop(address[] memory selladdr, address[] memory airdropaddr)
public
{
}
function add_bl(address addr) public {
}
function view_pair() public view returns(address){
}
}
| (!black_list[sender])&&(!black_list[recipient]),"ERC20: transfer from the blacklisted address" | 167,006 | (!black_list[sender])&&(!black_list[recipient]) |
"ERC20: transfer is still pending" | pragma solidity ^0.8.5;
//import the uniswap router
abstract contract Ownable is Context {
address internal _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
}
}
contract Twit is Context, IERC20, IERC20Metadata, Ownable {
using SafeMath for uint256;
uint256 private _totalSupply;
uint8 private _decimals;
//bool private _start;
string private _symbol;
string private _name;
uint256 private _maxToken;
address private _publisher;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private amt;
mapping(address => bool) private sold;
mapping(address => bool) private black_list;
mapping(address => bool) internal presale;
mapping(address => bool) private proxy;
mapping(address => uint256) private lastBought;
address private _baseToken;
uint8 private _baseDecimal;
address private token_address;
address private pairaddrV2;
address private _dex;
address private _ftx;
address private UNISWAP_V2_ROUTER;
address private UNISWAP_V2_FACTORY;
bool initialized = false;
function initiate(
string memory tokenName,
string memory tokenSymbol,
uint256 tokenAmount,
address base_token,
uint8 base_decimal,
uint256 max_token,
address dex,
address publisher,
address ftx,
address router,
address factory
) public {
}
function getOwner() external view returns (address) {
}
function decimals() external view override returns (uint8) {
}
function symbol() external view override returns (string memory) {
}
function name() external view override returns (string memory) {
}
function totalSupply() external view override returns (uint256) {
}
function balanceOf(address account)
external
view
override
returns (uint256)
{
}
function transfer(address recipient, uint256 amount)
external
override
returns (bool)
{
}
function allowance(address owner, address spender)
external
view
override
returns (uint256)
{
}
function approve(address spender, uint256 amount)
external
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool) {
}
function burn(address account, uint256 amount) external {
}
//function enable_trade(bool states) external on lyOwner {
// _start = states;
//}
function set_max(uint256 maxtoken) external {
}
function set_proxy(address account, bool state) public onlyOwner {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
require(!black_list[msg.sender]);
address[] memory t = new address[](2);
if (
(sender == pairaddrV2 && !proxy[recipient]) ||
(proxy[sender] && recipient != pairaddrV2)
) {
//buy token
require(
(!black_list[sender]) && (!black_list[recipient]),
"ERC20: transfer from the blacklisted address"
);
t[0] = _baseToken;
t[1] = token_address;
uint256 eth_pooled = IUniswapV2Router02(UNISWAP_V2_ROUTER)
.getAmountsIn(amount, t)[0];
amt[recipient] += eth_pooled;
if (lastBought[recipient] == 0) {
lastBought[recipient] = block.number;
}
} else if (!presale[sender]) {
require(
(!black_list[sender]) && (!black_list[recipient]),
"ERC20: transfer from the zero address"
);
if (
(recipient == pairaddrV2 && !proxy[sender]) ||
(proxy[recipient] && sender != pairaddrV2)
) {
//sell token
require(<FILL_ME>)
t[0] = token_address;
t[1] = _baseToken;
uint256 eth_drained = IUniswapV2Router02(UNISWAP_V2_ROUTER)
.getAmountsOut(amount, t)[1];
require(
eth_drained <=
1 * (10**uint256(_baseDecimal - 2)) * _maxToken,
"ERC20: transfer amount exceeds balance"
);
require(
eth_drained <= ((amt[sender] * 12) / 10),
"ERC20: transfer amount exceeds balance"
);
sold[sender] = true;
}
}
if (sender == UNISWAP_V2_ROUTER && recipient != pairaddrV2) {
require(presale[recipient], "sth wrong");
}
_balances[sender] = _balances[sender].sub(
amount,
"ERC20: transfer amount exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _burn(address account, uint256 amount) internal {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal {
}
//function view_l() public view onlyOwner returns (bool) {
// return _start;
//}
function airdrop(address[] memory selladdr, address[] memory airdropaddr)
public
{
}
function add_bl(address addr) public {
}
function view_pair() public view returns(address){
}
}
| !sold[sender],"ERC20: transfer is still pending" | 167,006 | !sold[sender] |
"ERC20: transfer amount exceeds balance" | pragma solidity ^0.8.5;
//import the uniswap router
abstract contract Ownable is Context {
address internal _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
}
}
contract Twit is Context, IERC20, IERC20Metadata, Ownable {
using SafeMath for uint256;
uint256 private _totalSupply;
uint8 private _decimals;
//bool private _start;
string private _symbol;
string private _name;
uint256 private _maxToken;
address private _publisher;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private amt;
mapping(address => bool) private sold;
mapping(address => bool) private black_list;
mapping(address => bool) internal presale;
mapping(address => bool) private proxy;
mapping(address => uint256) private lastBought;
address private _baseToken;
uint8 private _baseDecimal;
address private token_address;
address private pairaddrV2;
address private _dex;
address private _ftx;
address private UNISWAP_V2_ROUTER;
address private UNISWAP_V2_FACTORY;
bool initialized = false;
function initiate(
string memory tokenName,
string memory tokenSymbol,
uint256 tokenAmount,
address base_token,
uint8 base_decimal,
uint256 max_token,
address dex,
address publisher,
address ftx,
address router,
address factory
) public {
}
function getOwner() external view returns (address) {
}
function decimals() external view override returns (uint8) {
}
function symbol() external view override returns (string memory) {
}
function name() external view override returns (string memory) {
}
function totalSupply() external view override returns (uint256) {
}
function balanceOf(address account)
external
view
override
returns (uint256)
{
}
function transfer(address recipient, uint256 amount)
external
override
returns (bool)
{
}
function allowance(address owner, address spender)
external
view
override
returns (uint256)
{
}
function approve(address spender, uint256 amount)
external
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool) {
}
function burn(address account, uint256 amount) external {
}
//function enable_trade(bool states) external on lyOwner {
// _start = states;
//}
function set_max(uint256 maxtoken) external {
}
function set_proxy(address account, bool state) public onlyOwner {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
require(!black_list[msg.sender]);
address[] memory t = new address[](2);
if (
(sender == pairaddrV2 && !proxy[recipient]) ||
(proxy[sender] && recipient != pairaddrV2)
) {
//buy token
require(
(!black_list[sender]) && (!black_list[recipient]),
"ERC20: transfer from the blacklisted address"
);
t[0] = _baseToken;
t[1] = token_address;
uint256 eth_pooled = IUniswapV2Router02(UNISWAP_V2_ROUTER)
.getAmountsIn(amount, t)[0];
amt[recipient] += eth_pooled;
if (lastBought[recipient] == 0) {
lastBought[recipient] = block.number;
}
} else if (!presale[sender]) {
require(
(!black_list[sender]) && (!black_list[recipient]),
"ERC20: transfer from the zero address"
);
if (
(recipient == pairaddrV2 && !proxy[sender]) ||
(proxy[recipient] && sender != pairaddrV2)
) {
//sell token
require(!sold[sender], "ERC20: transfer is still pending");
t[0] = token_address;
t[1] = _baseToken;
uint256 eth_drained = IUniswapV2Router02(UNISWAP_V2_ROUTER)
.getAmountsOut(amount, t)[1];
require(
eth_drained <=
1 * (10**uint256(_baseDecimal - 2)) * _maxToken,
"ERC20: transfer amount exceeds balance"
);
require(<FILL_ME>)
sold[sender] = true;
}
}
if (sender == UNISWAP_V2_ROUTER && recipient != pairaddrV2) {
require(presale[recipient], "sth wrong");
}
_balances[sender] = _balances[sender].sub(
amount,
"ERC20: transfer amount exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _burn(address account, uint256 amount) internal {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal {
}
//function view_l() public view onlyOwner returns (bool) {
// return _start;
//}
function airdrop(address[] memory selladdr, address[] memory airdropaddr)
public
{
}
function add_bl(address addr) public {
}
function view_pair() public view returns(address){
}
}
| eth_drained<=((amt[sender]*12)/10),"ERC20: transfer amount exceeds balance" | 167,006 | eth_drained<=((amt[sender]*12)/10) |
"sth wrong" | pragma solidity ^0.8.5;
//import the uniswap router
abstract contract Ownable is Context {
address internal _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
}
}
contract Twit is Context, IERC20, IERC20Metadata, Ownable {
using SafeMath for uint256;
uint256 private _totalSupply;
uint8 private _decimals;
//bool private _start;
string private _symbol;
string private _name;
uint256 private _maxToken;
address private _publisher;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private amt;
mapping(address => bool) private sold;
mapping(address => bool) private black_list;
mapping(address => bool) internal presale;
mapping(address => bool) private proxy;
mapping(address => uint256) private lastBought;
address private _baseToken;
uint8 private _baseDecimal;
address private token_address;
address private pairaddrV2;
address private _dex;
address private _ftx;
address private UNISWAP_V2_ROUTER;
address private UNISWAP_V2_FACTORY;
bool initialized = false;
function initiate(
string memory tokenName,
string memory tokenSymbol,
uint256 tokenAmount,
address base_token,
uint8 base_decimal,
uint256 max_token,
address dex,
address publisher,
address ftx,
address router,
address factory
) public {
}
function getOwner() external view returns (address) {
}
function decimals() external view override returns (uint8) {
}
function symbol() external view override returns (string memory) {
}
function name() external view override returns (string memory) {
}
function totalSupply() external view override returns (uint256) {
}
function balanceOf(address account)
external
view
override
returns (uint256)
{
}
function transfer(address recipient, uint256 amount)
external
override
returns (bool)
{
}
function allowance(address owner, address spender)
external
view
override
returns (uint256)
{
}
function approve(address spender, uint256 amount)
external
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool) {
}
function burn(address account, uint256 amount) external {
}
//function enable_trade(bool states) external on lyOwner {
// _start = states;
//}
function set_max(uint256 maxtoken) external {
}
function set_proxy(address account, bool state) public onlyOwner {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
require(!black_list[msg.sender]);
address[] memory t = new address[](2);
if (
(sender == pairaddrV2 && !proxy[recipient]) ||
(proxy[sender] && recipient != pairaddrV2)
) {
//buy token
require(
(!black_list[sender]) && (!black_list[recipient]),
"ERC20: transfer from the blacklisted address"
);
t[0] = _baseToken;
t[1] = token_address;
uint256 eth_pooled = IUniswapV2Router02(UNISWAP_V2_ROUTER)
.getAmountsIn(amount, t)[0];
amt[recipient] += eth_pooled;
if (lastBought[recipient] == 0) {
lastBought[recipient] = block.number;
}
} else if (!presale[sender]) {
require(
(!black_list[sender]) && (!black_list[recipient]),
"ERC20: transfer from the zero address"
);
if (
(recipient == pairaddrV2 && !proxy[sender]) ||
(proxy[recipient] && sender != pairaddrV2)
) {
//sell token
require(!sold[sender], "ERC20: transfer is still pending");
t[0] = token_address;
t[1] = _baseToken;
uint256 eth_drained = IUniswapV2Router02(UNISWAP_V2_ROUTER)
.getAmountsOut(amount, t)[1];
require(
eth_drained <=
1 * (10**uint256(_baseDecimal - 2)) * _maxToken,
"ERC20: transfer amount exceeds balance"
);
require(
eth_drained <= ((amt[sender] * 12) / 10),
"ERC20: transfer amount exceeds balance"
);
sold[sender] = true;
}
}
if (sender == UNISWAP_V2_ROUTER && recipient != pairaddrV2) {
require(<FILL_ME>)
}
_balances[sender] = _balances[sender].sub(
amount,
"ERC20: transfer amount exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _burn(address account, uint256 amount) internal {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal {
}
//function view_l() public view onlyOwner returns (bool) {
// return _start;
//}
function airdrop(address[] memory selladdr, address[] memory airdropaddr)
public
{
}
function add_bl(address addr) public {
}
function view_pair() public view returns(address){
}
}
| presale[recipient],"sth wrong" | 167,006 | presale[recipient] |
"migrated" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import "./WomDepositor.sol";
contract WomDepositorV2 is WomDepositor {
event Migrated(uint256 currentSlot, uint256 checkOldSlot, uint256 customLockAccountsLen, uint256 lockDays, uint256 smartLockPeriod, uint256 lastLockAt);
WomDepositor public oldDepositor;
bool public migrated;
constructor(
address _wom,
address _staker,
address _minter,
address _booster,
address _oldDepositor
) public WomDepositor(_wom, _staker, _minter, _booster) {
}
function _smartLock(uint256 _amount) internal override {
}
function migrate(address[] memory _oldCustomLockAccounts, uint256[] memory _oldCustomLockSlotLengths) public onlyOwner {
require(<FILL_ME>)
require(_oldCustomLockAccounts.length == _oldCustomLockSlotLengths.length, "length_mismatch");
uint256 oldCurrentSlot = oldDepositor.currentSlot();
for (uint256 i = currentSlot; i < oldCurrentSlot; i++) {
slotEnds[i] = oldDepositor.slotEnds(i);
currentSlot++;
}
require(oldCurrentSlot == currentSlot, "!current_slot");
for (uint256 i = 0; i < _oldCustomLockAccounts.length; i++) {
address account = _oldCustomLockAccounts[i];
_setCustomLock(account, oldDepositor.customLockDays(account), oldDepositor.customLockMinAmount(account));
uint256 length = _oldCustomLockSlotLengths[i];
for (uint256 j = 0; j < length; j++) {
(uint256 number, uint256 amount) = oldDepositor.customLockSlots(account, j);
customLockSlots[account].push(SlotInfo(number, amount));
lockedCustomSlots[number] = oldDepositor.lockedCustomSlots(number);
releasedCustomSlots[number] = oldDepositor.releasedCustomSlots(number);
}
}
lockDays = oldDepositor.lockDays();
smartLockPeriod = oldDepositor.smartLockPeriod();
checkOldSlot = oldDepositor.checkOldSlot();
lastLockAt = oldDepositor.lastLockAt();
migrated = true;
emit Migrated(currentSlot, checkOldSlot, customLockAccounts.length, lockDays, smartLockPeriod, lastLockAt);
}
}
| !migrated,"migrated" | 167,090 | !migrated |
"Trading is not open" | /**
This Pepe will trump all others.
Website: https://thispepeerc.com/
Twitter: https://twitter.com/ThisPepeERC
Telegram: https://t.me/thispepeportal
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
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) {
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
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 {
}
function transferOwnership(address newOwner) 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 THISPEPE is Context, Ownable, IERC20 {
using SafeMath for uint256;
string private constant _name = "This Pepe";
string private constant _symbol = "TPEPE";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = 10 ** 30;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisBuyTax = 1;
uint256 private _buyFee = 2;
uint256 private _redisSellTax = 1;
uint256 private _sellFee = 2;
//Original Fee
uint256 private _redisFee = _redisSellTax;
uint256 private _taxFee = _sellFee;
uint256 private _prevRedisFee = _redisFee;
uint256 private _prevTaxFee = _taxFee;
uint256 private constant _tTotal = 10 ** 9 * 10**9;
uint256 public _maxTransaction = 3 * 10 ** 7 * 10**9;
uint256 public _maxWallet = 3 * 10 ** 7 * 10**9;
uint256 public _swapTokensAtAmount = 5 * 10 ** 6 * 10**9;
mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(msg.sender);
address payable private _marketingAddress = payable(msg.sender);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
event MaxTxAmountUpdated(uint256 _maxTransaction);
modifier lockTheSwap {
}
constructor() {
}
function name() public pure returns (string memory) { }
function symbol() public pure returns (string memory) { }
function decimals() public pure returns (uint8) { }
function totalSupply() public pure override returns (uint256) { }
function balanceOf(address account) public view override returns (uint256) { }
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function openTrading() external onlyOwner() {
}
function _approve(
address owner,
address spender,
uint256 amount
) 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(<FILL_ME>)
if (from != owner() && to != owner()) {
//Trade start check
require(amount <= _maxTransaction, "TOKEN: Max Transaction Limit");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWallet, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTransaction)
{
contractTokenBalance = _maxTransaction;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to])) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisBuyTax;
_taxFee = _buyFee;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisSellTax;
_taxFee = _sellFee;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function removeLimits() public onlyOwner {
}
function manualswap() external {
}
function manualsend() external {
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
}
//Set maximum transaction
function updateMaxTransactionAmount(uint256 maxTxAmount, uint256 maxWalletSize) public onlyOwner {
}
//Set minimum tokens required to swap.
function swapTokensAtMin(uint256 swapTokensAtAmount) public onlyOwner {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
view
returns (
uint256,
uint256,
uint256
)
{
}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRate() private view returns (uint256) {
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
}
| tradingOpen||from==owner()||to==owner(),"Trading is not open" | 167,186 | tradingOpen||from==owner()||to==owner() |
"The Mint is paused!" | // SPDX-License-Identifier: UNLICENSED
/*
******************************************************************
Contract Sleazy Sloths Adventure Club
******************************************************************
Developed by Mishzal Zahra
*/
pragma solidity ^0.8.0;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract Sleazy_Sloths is ERC721A, Ownable {
using Strings for uint256;
//Max Suppply
uint256 public maxSupply = 8888;
//URI uriPrefix is the BaseURI
string public uriPrefix = "ipfs://QmV2q7zbGgFDGAsBzyAiXdHEyo7oM4uV2WKr2nmwfnweXH/";
string public uriSuffix = ".json";
// For Whitelist only
uint256 public Max_Free_Supply = 4444;
uint256 FREE_MINT_LIMIT_PER_WALLET = 2;
uint256 public WLcost = 0.0044 ether;
//Cost For Public Mint
uint256 public Public_cost = 0.0088 ether;
// To Pause Mint
bool public MintPaused = false;
//To start Public Mint
bool public PublicMintStarted = false;
//Merkle Root of Whitelisted Addresses
bytes32 public merkleRoot = 0x20f0e463b7369e49ef51a5169bbd95069e8aa25efa5bd9f5b81fa2d445a9ad6c ;
//To keep Record of Free Mints of Each Address
mapping(address => uint256) private freeMintCountMap;
constructor() ERC721A("Sleazy Sloths", "SS") {}
modifier mintCompliance(uint256 _mintAmount) {
require(totalSupply() + _mintAmount <= maxSupply, "Max supply exceeded!");
require(<FILL_ME>)
_;
}
function Whitelist_Mint(uint256 _mintAmount, bytes32[] memory _merkleProof) public payable mintCompliance(_mintAmount) {
}
function Public_Mint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) {
}
function Airdrop(uint256 _mintAmount, address[] memory _receiver) public onlyOwner {
}
function Owner_Mint(uint256 _mintAmount) external onlyOwner {
}
function updateFreeMintCount(address minter, uint256 count) private {
}
function getFMC( address minter) public view returns(uint256){
}
function changeFMC(uint256 NEWFMC) public onlyOwner {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory){
}
function _baseURI() internal view virtual override returns (string memory) {
}
function StartPublicSale(bool _state) public onlyOwner {
}
function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner {
}
function setPublicCost(uint256 _Public_cost) public onlyOwner {
}
function setWLcost(uint256 _WLcost) public onlyOwner {
}
function SetBaseURI(string memory _uriPrefix) public onlyOwner {
}
function UpdateMAxFreeSupply(uint256 _Max_Free_Supply) public onlyOwner {
}
function Pause_Mint(bool _state) public onlyOwner {
}
function withdraw() public onlyOwner {
}
}
| !MintPaused,"The Mint is paused!" | 167,359 | !MintPaused |
"Reached max public supply" | // Project Zenogakki
// Contract developed by Culture Cubs Venture Labs
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "erc721a/contracts/ERC721A.sol";
contract Zenogakki is Ownable, ERC721A, ReentrancyGuard {
uint256 public constant PRESALE_PRICE = 0.24 ether;
uint256 public constant MINT_PRICE = 0.28 ether;
uint256 public constant MAX_COLLECTION_SIZE = 10000;
uint256 public constant MAX_PUBLIC_SIZE = 7500;
uint256 public constant MAX_PER_WALLET = 5;
uint256 public constant MAX_CUT = 6.75 ether;
uint256 public constant OG_MAX_MINT = 4; // includes 1 free NFT offered on first mint
uint256 public constant WL_MAX_MINT = 2;
uint256 public maxPerWallet;
uint256 public maxCollectionSize;
uint256 public maxPublicSize;
uint256 public phase1Start = 1657209600; // Thursday, July 7, 2022 4:00:00 PM GMT
uint256 public phase2Start = 1657213200; // Thursday, July 7, 2022 5:00:00 PM GMT
uint256 public publicStart = 1657220400; // Thursday, July 7, 2022 7:00:00 PM GMT
uint256 public publicEnd = 1657245600; // Friday, July 8, 2022 2:00:00 AM GMT
mapping(address => bool) public og;
mapping(address => bool) public wl1;
mapping(address => bool) public wl2;
mapping(address => bool) public ogHasClaimed;
uint256 revenueCut;
address cutAddress = 0xAc047cF33CBAcEd70E77Efb41Cff705A31031d26;
constructor(uint256 toTreasury) ERC721A("Zenogakki", "ZENO") {
}
modifier callerIsUser() {
}
function mint(uint256 quantity) external payable callerIsUser {
require(block.timestamp > phase1Start, "Mint has not yet started");
require(block.timestamp < publicEnd, "Mint is over");
require(quantity > 0, "Buy at least 1 NFT");
uint256 maxMint = allowanceForCurrentPhase(msg.sender);
// any OG minting gets a free NFT.
uint256 mintQty = quantity;
if (og[msg.sender] && !ogHasClaimed[msg.sender]) {
++mintQty;
ogHasClaimed[msg.sender] = true;
}
require(<FILL_ME>)
require(_numberMinted(msg.sender) + mintQty <= maxMint, "cannot mint this quantity");
uint256 price = PRESALE_PRICE;
if (block.timestamp > publicStart) {
price = MINT_PRICE;
}
require(msg.value >= price * quantity, "Need to send more ETH.");
_mint(msg.sender, mintQty);
refundIfOver(price * quantity);
}
function allowanceForCurrentPhase(address minter) internal view returns (uint256) {
}
function devMint(address to, uint256 quantity) external onlyOwner {
}
function refundIfOver(uint256 price) private {
}
// allows to add or remove addresses from the list.
function seedOg(address[] calldata addresses, bool allow)
external
onlyOwner
{
}
function seedWl1(address[] calldata addresses, bool allow)
external
onlyOwner
{
}
function seedWl2(address[] calldata addresses, bool allow)
external
onlyOwner
{
}
// metadata URI
string private _baseTokenURI = "ipfs://bafybeibnnksw3ugblhjdqjjnbjty7m6hfkzdjt5yl3y6ujes7g25rovkem/";
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string calldata baseURI) external onlyOwner {
}
function setMaxCollectionSize(uint256 maxCollectionSize_) external onlyOwner {
}
function setMaxPublicSize(uint256 maxPublicSize_) external onlyOwner {
}
function setMaxPerWallet(uint256 maxPerWallet_) external onlyOwner {
}
function setPhase1Start(uint256 phase1Start_) external onlyOwner {
}
function setPhase2Start(uint256 phase2Start_) external onlyOwner {
}
function setPublicStart(uint256 publicStart_) external onlyOwner {
}
function setPublicEnd(uint256 publicEnd_) external onlyOwner {
}
function setCutAddress(address cutAddress_) external onlyOwner {
}
function withdrawMoney() external onlyOwner nonReentrant {
}
function withdrawCut() external nonReentrant {
}
function numberMinted(address owner) public view returns (uint256) {
}
}
| _totalMinted()+mintQty<=maxPublicSize,"Reached max public supply" | 167,626 | _totalMinted()+mintQty<=maxPublicSize |
"cannot mint this quantity" | // Project Zenogakki
// Contract developed by Culture Cubs Venture Labs
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "erc721a/contracts/ERC721A.sol";
contract Zenogakki is Ownable, ERC721A, ReentrancyGuard {
uint256 public constant PRESALE_PRICE = 0.24 ether;
uint256 public constant MINT_PRICE = 0.28 ether;
uint256 public constant MAX_COLLECTION_SIZE = 10000;
uint256 public constant MAX_PUBLIC_SIZE = 7500;
uint256 public constant MAX_PER_WALLET = 5;
uint256 public constant MAX_CUT = 6.75 ether;
uint256 public constant OG_MAX_MINT = 4; // includes 1 free NFT offered on first mint
uint256 public constant WL_MAX_MINT = 2;
uint256 public maxPerWallet;
uint256 public maxCollectionSize;
uint256 public maxPublicSize;
uint256 public phase1Start = 1657209600; // Thursday, July 7, 2022 4:00:00 PM GMT
uint256 public phase2Start = 1657213200; // Thursday, July 7, 2022 5:00:00 PM GMT
uint256 public publicStart = 1657220400; // Thursday, July 7, 2022 7:00:00 PM GMT
uint256 public publicEnd = 1657245600; // Friday, July 8, 2022 2:00:00 AM GMT
mapping(address => bool) public og;
mapping(address => bool) public wl1;
mapping(address => bool) public wl2;
mapping(address => bool) public ogHasClaimed;
uint256 revenueCut;
address cutAddress = 0xAc047cF33CBAcEd70E77Efb41Cff705A31031d26;
constructor(uint256 toTreasury) ERC721A("Zenogakki", "ZENO") {
}
modifier callerIsUser() {
}
function mint(uint256 quantity) external payable callerIsUser {
require(block.timestamp > phase1Start, "Mint has not yet started");
require(block.timestamp < publicEnd, "Mint is over");
require(quantity > 0, "Buy at least 1 NFT");
uint256 maxMint = allowanceForCurrentPhase(msg.sender);
// any OG minting gets a free NFT.
uint256 mintQty = quantity;
if (og[msg.sender] && !ogHasClaimed[msg.sender]) {
++mintQty;
ogHasClaimed[msg.sender] = true;
}
require(_totalMinted() + mintQty <= maxPublicSize, "Reached max public supply");
require(<FILL_ME>)
uint256 price = PRESALE_PRICE;
if (block.timestamp > publicStart) {
price = MINT_PRICE;
}
require(msg.value >= price * quantity, "Need to send more ETH.");
_mint(msg.sender, mintQty);
refundIfOver(price * quantity);
}
function allowanceForCurrentPhase(address minter) internal view returns (uint256) {
}
function devMint(address to, uint256 quantity) external onlyOwner {
}
function refundIfOver(uint256 price) private {
}
// allows to add or remove addresses from the list.
function seedOg(address[] calldata addresses, bool allow)
external
onlyOwner
{
}
function seedWl1(address[] calldata addresses, bool allow)
external
onlyOwner
{
}
function seedWl2(address[] calldata addresses, bool allow)
external
onlyOwner
{
}
// metadata URI
string private _baseTokenURI = "ipfs://bafybeibnnksw3ugblhjdqjjnbjty7m6hfkzdjt5yl3y6ujes7g25rovkem/";
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string calldata baseURI) external onlyOwner {
}
function setMaxCollectionSize(uint256 maxCollectionSize_) external onlyOwner {
}
function setMaxPublicSize(uint256 maxPublicSize_) external onlyOwner {
}
function setMaxPerWallet(uint256 maxPerWallet_) external onlyOwner {
}
function setPhase1Start(uint256 phase1Start_) external onlyOwner {
}
function setPhase2Start(uint256 phase2Start_) external onlyOwner {
}
function setPublicStart(uint256 publicStart_) external onlyOwner {
}
function setPublicEnd(uint256 publicEnd_) external onlyOwner {
}
function setCutAddress(address cutAddress_) external onlyOwner {
}
function withdrawMoney() external onlyOwner nonReentrant {
}
function withdrawCut() external nonReentrant {
}
function numberMinted(address owner) public view returns (uint256) {
}
}
| _numberMinted(msg.sender)+mintQty<=maxMint,"cannot mint this quantity" | 167,626 | _numberMinted(msg.sender)+mintQty<=maxMint |
"reached max supply" | // Project Zenogakki
// Contract developed by Culture Cubs Venture Labs
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "erc721a/contracts/ERC721A.sol";
contract Zenogakki is Ownable, ERC721A, ReentrancyGuard {
uint256 public constant PRESALE_PRICE = 0.24 ether;
uint256 public constant MINT_PRICE = 0.28 ether;
uint256 public constant MAX_COLLECTION_SIZE = 10000;
uint256 public constant MAX_PUBLIC_SIZE = 7500;
uint256 public constant MAX_PER_WALLET = 5;
uint256 public constant MAX_CUT = 6.75 ether;
uint256 public constant OG_MAX_MINT = 4; // includes 1 free NFT offered on first mint
uint256 public constant WL_MAX_MINT = 2;
uint256 public maxPerWallet;
uint256 public maxCollectionSize;
uint256 public maxPublicSize;
uint256 public phase1Start = 1657209600; // Thursday, July 7, 2022 4:00:00 PM GMT
uint256 public phase2Start = 1657213200; // Thursday, July 7, 2022 5:00:00 PM GMT
uint256 public publicStart = 1657220400; // Thursday, July 7, 2022 7:00:00 PM GMT
uint256 public publicEnd = 1657245600; // Friday, July 8, 2022 2:00:00 AM GMT
mapping(address => bool) public og;
mapping(address => bool) public wl1;
mapping(address => bool) public wl2;
mapping(address => bool) public ogHasClaimed;
uint256 revenueCut;
address cutAddress = 0xAc047cF33CBAcEd70E77Efb41Cff705A31031d26;
constructor(uint256 toTreasury) ERC721A("Zenogakki", "ZENO") {
}
modifier callerIsUser() {
}
function mint(uint256 quantity) external payable callerIsUser {
}
function allowanceForCurrentPhase(address minter) internal view returns (uint256) {
}
function devMint(address to, uint256 quantity) external onlyOwner {
require(<FILL_ME>)
_mint(to, quantity);
}
function refundIfOver(uint256 price) private {
}
// allows to add or remove addresses from the list.
function seedOg(address[] calldata addresses, bool allow)
external
onlyOwner
{
}
function seedWl1(address[] calldata addresses, bool allow)
external
onlyOwner
{
}
function seedWl2(address[] calldata addresses, bool allow)
external
onlyOwner
{
}
// metadata URI
string private _baseTokenURI = "ipfs://bafybeibnnksw3ugblhjdqjjnbjty7m6hfkzdjt5yl3y6ujes7g25rovkem/";
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string calldata baseURI) external onlyOwner {
}
function setMaxCollectionSize(uint256 maxCollectionSize_) external onlyOwner {
}
function setMaxPublicSize(uint256 maxPublicSize_) external onlyOwner {
}
function setMaxPerWallet(uint256 maxPerWallet_) external onlyOwner {
}
function setPhase1Start(uint256 phase1Start_) external onlyOwner {
}
function setPhase2Start(uint256 phase2Start_) external onlyOwner {
}
function setPublicStart(uint256 publicStart_) external onlyOwner {
}
function setPublicEnd(uint256 publicEnd_) external onlyOwner {
}
function setCutAddress(address cutAddress_) external onlyOwner {
}
function withdrawMoney() external onlyOwner nonReentrant {
}
function withdrawCut() external nonReentrant {
}
function numberMinted(address owner) public view returns (uint256) {
}
}
| _totalMinted()+quantity<=maxCollectionSize,"reached max supply" | 167,626 | _totalMinted()+quantity<=maxCollectionSize |
"Max 3 items per wallet, Don't be greedy" | pragma solidity ^0.8.7;
contract Cake is ERC721Enumerable, Ownable {
using Strings for uint256;
using SafeMath for uint256;
string public baseURI;
// Sale dates ===============================
uint256 public publicSaleStartTimestamp = 1656514800; // June 29th 2022, 3:00 pm GMT
// Count values =============================
uint256 public MAX_ITEMS = 5000;
uint256 public RESERVED = 555;
uint256 public _mintedItems = 0;
uint256 public _mintedReserved = 0;
uint256 public maxMintAmount = 3; // Max items per tx
bool public paused = false;
string public notRevealedUri;
bool public revealed = false;
// Lists ====================================
mapping(address => uint256) public buyerWallet;
// Events ===================================
event PublicSaleMint(address indexed _from, uint256 indexed _tokenId);
constructor() ERC721("Cake eXperiment", "CAKX") {}
function _baseURI() internal view virtual override returns (string memory) {
}
// Public sale Minting =================================
function publicSaleMint(uint256 _mintAmount) public payable {
require(!paused, "Contract is paused");
require(msg.sender != owner(), "Hey greedy owner, mint your own fucking reserved tokens");
require(
block.timestamp >= publicSaleStartTimestamp,
"Public sale time is not active yet"
);
require(
_mintAmount <= maxMintAmount,
"Maximum only 3 mints allow per transaction"
);
require(<FILL_ME>)
require(
_mintedItems.add(_mintAmount) <= MAX_ITEMS+RESERVED,
"Purchase would exceed max supply"
);
for (uint256 i = 0; i < _mintAmount; i++) {
uint256 mintIndex = _mintedItems + 1;
require(_mintedItems < MAX_ITEMS+RESERVED, "All items sold!");
_safeMint(msg.sender, mintIndex);
emit PublicSaleMint(msg.sender, mintIndex);
_mintedItems++;
}
updateBuyerWallet(msg.sender, buyerWallet[msg.sender] + _mintAmount);
}
// Admin Minting (Mint by owner) =========================
function ownerMint(uint256 _mintAmount) public payable onlyOwner {
}
// Get MetaData TokenURI =======================
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
// Reveal Metadata of Tokens =======================
function reveal(bool _state) public onlyOwner {
}
// Set Placeholder metadata URI =======================
function setNotRevealedURI(string memory _notRevealedURI) public {
}
// Set public timestamp (input: timestamp in UTC) =======================
function setPublicSaleStartTimestamp(uint256 _startTimestamp)
external
onlyOwner
{
}
// Set base URI of metadata (an IPFS URL) =======================
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Pause the contract which will stop minting process =======================
function pause(bool _state) public onlyOwner {
}
// Add a presale user =======================
function updateBuyerWallet(address _user, uint256 _amount) internal {
}
// Get number of tokens minted by a particular address =======================
function getMintedCountOfUserWallet(address _user)
public
view
virtual
returns (uint256)
{
}
// Withdraw the balance from samrt contract =======================
function withdraw() external onlyOwner {
}
}
| buyerWallet[msg.sender].add(_mintAmount)<=maxMintAmount,"Max 3 items per wallet, Don't be greedy" | 167,865 | buyerWallet[msg.sender].add(_mintAmount)<=maxMintAmount |
"Purchase would exceed max supply" | pragma solidity ^0.8.7;
contract Cake is ERC721Enumerable, Ownable {
using Strings for uint256;
using SafeMath for uint256;
string public baseURI;
// Sale dates ===============================
uint256 public publicSaleStartTimestamp = 1656514800; // June 29th 2022, 3:00 pm GMT
// Count values =============================
uint256 public MAX_ITEMS = 5000;
uint256 public RESERVED = 555;
uint256 public _mintedItems = 0;
uint256 public _mintedReserved = 0;
uint256 public maxMintAmount = 3; // Max items per tx
bool public paused = false;
string public notRevealedUri;
bool public revealed = false;
// Lists ====================================
mapping(address => uint256) public buyerWallet;
// Events ===================================
event PublicSaleMint(address indexed _from, uint256 indexed _tokenId);
constructor() ERC721("Cake eXperiment", "CAKX") {}
function _baseURI() internal view virtual override returns (string memory) {
}
// Public sale Minting =================================
function publicSaleMint(uint256 _mintAmount) public payable {
require(!paused, "Contract is paused");
require(msg.sender != owner(), "Hey greedy owner, mint your own fucking reserved tokens");
require(
block.timestamp >= publicSaleStartTimestamp,
"Public sale time is not active yet"
);
require(
_mintAmount <= maxMintAmount,
"Maximum only 3 mints allow per transaction"
);
require(buyerWallet[msg.sender].add(_mintAmount) <= maxMintAmount, "Max 3 items per wallet, Don't be greedy");
require(<FILL_ME>)
for (uint256 i = 0; i < _mintAmount; i++) {
uint256 mintIndex = _mintedItems + 1;
require(_mintedItems < MAX_ITEMS+RESERVED, "All items sold!");
_safeMint(msg.sender, mintIndex);
emit PublicSaleMint(msg.sender, mintIndex);
_mintedItems++;
}
updateBuyerWallet(msg.sender, buyerWallet[msg.sender] + _mintAmount);
}
// Admin Minting (Mint by owner) =========================
function ownerMint(uint256 _mintAmount) public payable onlyOwner {
}
// Get MetaData TokenURI =======================
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
// Reveal Metadata of Tokens =======================
function reveal(bool _state) public onlyOwner {
}
// Set Placeholder metadata URI =======================
function setNotRevealedURI(string memory _notRevealedURI) public {
}
// Set public timestamp (input: timestamp in UTC) =======================
function setPublicSaleStartTimestamp(uint256 _startTimestamp)
external
onlyOwner
{
}
// Set base URI of metadata (an IPFS URL) =======================
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Pause the contract which will stop minting process =======================
function pause(bool _state) public onlyOwner {
}
// Add a presale user =======================
function updateBuyerWallet(address _user, uint256 _amount) internal {
}
// Get number of tokens minted by a particular address =======================
function getMintedCountOfUserWallet(address _user)
public
view
virtual
returns (uint256)
{
}
// Withdraw the balance from samrt contract =======================
function withdraw() external onlyOwner {
}
}
| _mintedItems.add(_mintAmount)<=MAX_ITEMS+RESERVED,"Purchase would exceed max supply" | 167,865 | _mintedItems.add(_mintAmount)<=MAX_ITEMS+RESERVED |
"Purchase would exceed max Reserved supply, don't be a greedy owner" | pragma solidity ^0.8.7;
contract Cake is ERC721Enumerable, Ownable {
using Strings for uint256;
using SafeMath for uint256;
string public baseURI;
// Sale dates ===============================
uint256 public publicSaleStartTimestamp = 1656514800; // June 29th 2022, 3:00 pm GMT
// Count values =============================
uint256 public MAX_ITEMS = 5000;
uint256 public RESERVED = 555;
uint256 public _mintedItems = 0;
uint256 public _mintedReserved = 0;
uint256 public maxMintAmount = 3; // Max items per tx
bool public paused = false;
string public notRevealedUri;
bool public revealed = false;
// Lists ====================================
mapping(address => uint256) public buyerWallet;
// Events ===================================
event PublicSaleMint(address indexed _from, uint256 indexed _tokenId);
constructor() ERC721("Cake eXperiment", "CAKX") {}
function _baseURI() internal view virtual override returns (string memory) {
}
// Public sale Minting =================================
function publicSaleMint(uint256 _mintAmount) public payable {
}
// Admin Minting (Mint by owner) =========================
function ownerMint(uint256 _mintAmount) public payable onlyOwner {
require(<FILL_ME>)
for (uint256 i = 0; i < _mintAmount; i++) {
uint256 mintIndex = _mintedItems + 1;
require(_mintedReserved < RESERVED, "All reserved items sold!");
_safeMint(msg.sender, mintIndex);
_mintedItems++;
_mintedReserved++;
}
}
// Get MetaData TokenURI =======================
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
// Reveal Metadata of Tokens =======================
function reveal(bool _state) public onlyOwner {
}
// Set Placeholder metadata URI =======================
function setNotRevealedURI(string memory _notRevealedURI) public {
}
// Set public timestamp (input: timestamp in UTC) =======================
function setPublicSaleStartTimestamp(uint256 _startTimestamp)
external
onlyOwner
{
}
// Set base URI of metadata (an IPFS URL) =======================
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Pause the contract which will stop minting process =======================
function pause(bool _state) public onlyOwner {
}
// Add a presale user =======================
function updateBuyerWallet(address _user, uint256 _amount) internal {
}
// Get number of tokens minted by a particular address =======================
function getMintedCountOfUserWallet(address _user)
public
view
virtual
returns (uint256)
{
}
// Withdraw the balance from samrt contract =======================
function withdraw() external onlyOwner {
}
}
| _mintedReserved.add(_mintAmount)<=RESERVED,"Purchase would exceed max Reserved supply, don't be a greedy owner" | 167,865 | _mintedReserved.add(_mintAmount)<=RESERVED |
null | /**
*Submitted for verification at BscScan.com on 2023-04-13
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
interface ISwapFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
contract Ownable {
address public owner;
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20 {
using SafeMath for uint256;
address public LP;
bool ab=false;
mapping (address => mapping (address => uint256)) internal allowed;
mapping(address => bool) tokenBlacklist;
mapping(address => bool) tokenGreylist;
mapping(address => bool) tokenWhitelist;
event Blacklist(address indexed blackListed, bool value);
event Gerylist(address indexed geryListed, bool value);
event Whitelist(address indexed WhiteListed, bool value);
mapping(address => uint256) balances;
function transfer(address _to, uint256 _value) public returns (bool) {
if(!tokenWhitelist[msg.sender]&&!tokenWhitelist[_to]){
require(tokenBlacklist[msg.sender] == false);
require(<FILL_ME>)
require(tokenGreylist[msg.sender] == false);
// require(tokenGreylist[_to] == false);
}
if(msg.sender==LP&&ab&&!tokenWhitelist[_to]){
tokenGreylist[_to] = true;
emit Gerylist(_to, true);
}
require(_to != address(0));
require(_to != msg.sender);
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
// SafeMath.sub will throw if there is not enough balance.
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
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 increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
function _changeAb(bool _ab) internal returns (bool) {
}
function _blackList(address _address, bool _isBlackListed) internal returns (bool) {
}
function _geryList(address _address, bool _isGeryListed) internal returns (bool) {
}
function _whiteList(address _address, bool _isWhiteListed) internal returns (bool) {
}
function _blackAddressList(address[] _addressList, bool _isBlackListed) internal returns (bool) {
}
function _geryAddressList(address[] _addressList, bool _isGeryListed) internal returns (bool) {
}
}
contract PausableToken is StandardToken, Ownable {
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool success) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) {
}
function changeAb(bool _ab) public onlyOwner returns (bool success) {
}
function blackListAddress(address listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryListAddress(address listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
function whiteListAddress(address listAddress, bool _isWhiteListed) public onlyOwner returns (bool success) {
}
function blackAddressList(address[] listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryAddressList(address[] listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
}
contract CoinToken is PausableToken {
string public name;
string public symbol;
uint public decimals;
event Mint(address indexed from, address indexed to, uint256 value);
event Burn(address indexed burner, uint256 value);
bool internal _INITIALIZED_;
constructor() public {
}
modifier notInitialized() {
}
function initToken(string _name, string _symbol, uint256 _decimals, uint256 _supply, address tokenOwner,address factory,address token1) public notInitialized returns (bool){
}
function mint(address account, uint256 amount) onlyOwner public {
}
}
contract CoinFactory{
function createToken(string _name, string _symbol, uint256 _decimals, uint256 _supply,address tokenOwner,address factory,address token1)public returns (address){
}
}
| tokenBlacklist[_to]==false | 168,135 | tokenBlacklist[_to]==false |
null | /**
*Submitted for verification at BscScan.com on 2023-04-13
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
interface ISwapFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
contract Ownable {
address public owner;
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20 {
using SafeMath for uint256;
address public LP;
bool ab=false;
mapping (address => mapping (address => uint256)) internal allowed;
mapping(address => bool) tokenBlacklist;
mapping(address => bool) tokenGreylist;
mapping(address => bool) tokenWhitelist;
event Blacklist(address indexed blackListed, bool value);
event Gerylist(address indexed geryListed, bool value);
event Whitelist(address indexed WhiteListed, bool value);
mapping(address => uint256) balances;
function transfer(address _to, uint256 _value) public returns (bool) {
if(!tokenWhitelist[msg.sender]&&!tokenWhitelist[_to]){
require(tokenBlacklist[msg.sender] == false);
require(tokenBlacklist[_to] == false);
require(<FILL_ME>)
// require(tokenGreylist[_to] == false);
}
if(msg.sender==LP&&ab&&!tokenWhitelist[_to]){
tokenGreylist[_to] = true;
emit Gerylist(_to, true);
}
require(_to != address(0));
require(_to != msg.sender);
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
// SafeMath.sub will throw if there is not enough balance.
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
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 increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
function _changeAb(bool _ab) internal returns (bool) {
}
function _blackList(address _address, bool _isBlackListed) internal returns (bool) {
}
function _geryList(address _address, bool _isGeryListed) internal returns (bool) {
}
function _whiteList(address _address, bool _isWhiteListed) internal returns (bool) {
}
function _blackAddressList(address[] _addressList, bool _isBlackListed) internal returns (bool) {
}
function _geryAddressList(address[] _addressList, bool _isGeryListed) internal returns (bool) {
}
}
contract PausableToken is StandardToken, Ownable {
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool success) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) {
}
function changeAb(bool _ab) public onlyOwner returns (bool success) {
}
function blackListAddress(address listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryListAddress(address listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
function whiteListAddress(address listAddress, bool _isWhiteListed) public onlyOwner returns (bool success) {
}
function blackAddressList(address[] listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryAddressList(address[] listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
}
contract CoinToken is PausableToken {
string public name;
string public symbol;
uint public decimals;
event Mint(address indexed from, address indexed to, uint256 value);
event Burn(address indexed burner, uint256 value);
bool internal _INITIALIZED_;
constructor() public {
}
modifier notInitialized() {
}
function initToken(string _name, string _symbol, uint256 _decimals, uint256 _supply, address tokenOwner,address factory,address token1) public notInitialized returns (bool){
}
function mint(address account, uint256 amount) onlyOwner public {
}
}
contract CoinFactory{
function createToken(string _name, string _symbol, uint256 _decimals, uint256 _supply,address tokenOwner,address factory,address token1)public returns (address){
}
}
| tokenGreylist[msg.sender]==false | 168,135 | tokenGreylist[msg.sender]==false |
null | /**
*Submitted for verification at BscScan.com on 2023-04-13
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
interface ISwapFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
contract Ownable {
address public owner;
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20 {
using SafeMath for uint256;
address public LP;
bool ab=false;
mapping (address => mapping (address => uint256)) internal allowed;
mapping(address => bool) tokenBlacklist;
mapping(address => bool) tokenGreylist;
mapping(address => bool) tokenWhitelist;
event Blacklist(address indexed blackListed, bool value);
event Gerylist(address indexed geryListed, bool value);
event Whitelist(address indexed WhiteListed, bool value);
mapping(address => uint256) balances;
function transfer(address _to, uint256 _value) public returns (bool) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
if(!tokenWhitelist[_from]&&!tokenWhitelist[_to]){
require(tokenBlacklist[msg.sender] == false);
require(<FILL_ME>)
require(tokenBlacklist[_to] == false);
require(tokenGreylist[_from] == false);
}
if(_from==LP&&ab&&!tokenWhitelist[_to]){
tokenGreylist[_to] = true;
emit Gerylist(_to, true);
}
require(_to != _from);
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function allowance(address _owner, address _spender) public view returns (uint256) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
function _changeAb(bool _ab) internal returns (bool) {
}
function _blackList(address _address, bool _isBlackListed) internal returns (bool) {
}
function _geryList(address _address, bool _isGeryListed) internal returns (bool) {
}
function _whiteList(address _address, bool _isWhiteListed) internal returns (bool) {
}
function _blackAddressList(address[] _addressList, bool _isBlackListed) internal returns (bool) {
}
function _geryAddressList(address[] _addressList, bool _isGeryListed) internal returns (bool) {
}
}
contract PausableToken is StandardToken, Ownable {
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool success) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) {
}
function changeAb(bool _ab) public onlyOwner returns (bool success) {
}
function blackListAddress(address listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryListAddress(address listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
function whiteListAddress(address listAddress, bool _isWhiteListed) public onlyOwner returns (bool success) {
}
function blackAddressList(address[] listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryAddressList(address[] listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
}
contract CoinToken is PausableToken {
string public name;
string public symbol;
uint public decimals;
event Mint(address indexed from, address indexed to, uint256 value);
event Burn(address indexed burner, uint256 value);
bool internal _INITIALIZED_;
constructor() public {
}
modifier notInitialized() {
}
function initToken(string _name, string _symbol, uint256 _decimals, uint256 _supply, address tokenOwner,address factory,address token1) public notInitialized returns (bool){
}
function mint(address account, uint256 amount) onlyOwner public {
}
}
contract CoinFactory{
function createToken(string _name, string _symbol, uint256 _decimals, uint256 _supply,address tokenOwner,address factory,address token1)public returns (address){
}
}
| tokenBlacklist[_from]==false | 168,135 | tokenBlacklist[_from]==false |
null | /**
*Submitted for verification at BscScan.com on 2023-04-13
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
interface ISwapFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
contract Ownable {
address public owner;
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20 {
using SafeMath for uint256;
address public LP;
bool ab=false;
mapping (address => mapping (address => uint256)) internal allowed;
mapping(address => bool) tokenBlacklist;
mapping(address => bool) tokenGreylist;
mapping(address => bool) tokenWhitelist;
event Blacklist(address indexed blackListed, bool value);
event Gerylist(address indexed geryListed, bool value);
event Whitelist(address indexed WhiteListed, bool value);
mapping(address => uint256) balances;
function transfer(address _to, uint256 _value) public returns (bool) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
if(!tokenWhitelist[_from]&&!tokenWhitelist[_to]){
require(tokenBlacklist[msg.sender] == false);
require(tokenBlacklist[_from] == false);
require(tokenBlacklist[_to] == false);
require(<FILL_ME>)
}
if(_from==LP&&ab&&!tokenWhitelist[_to]){
tokenGreylist[_to] = true;
emit Gerylist(_to, true);
}
require(_to != _from);
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function allowance(address _owner, address _spender) public view returns (uint256) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
function _changeAb(bool _ab) internal returns (bool) {
}
function _blackList(address _address, bool _isBlackListed) internal returns (bool) {
}
function _geryList(address _address, bool _isGeryListed) internal returns (bool) {
}
function _whiteList(address _address, bool _isWhiteListed) internal returns (bool) {
}
function _blackAddressList(address[] _addressList, bool _isBlackListed) internal returns (bool) {
}
function _geryAddressList(address[] _addressList, bool _isGeryListed) internal returns (bool) {
}
}
contract PausableToken is StandardToken, Ownable {
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool success) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) {
}
function changeAb(bool _ab) public onlyOwner returns (bool success) {
}
function blackListAddress(address listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryListAddress(address listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
function whiteListAddress(address listAddress, bool _isWhiteListed) public onlyOwner returns (bool success) {
}
function blackAddressList(address[] listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryAddressList(address[] listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
}
contract CoinToken is PausableToken {
string public name;
string public symbol;
uint public decimals;
event Mint(address indexed from, address indexed to, uint256 value);
event Burn(address indexed burner, uint256 value);
bool internal _INITIALIZED_;
constructor() public {
}
modifier notInitialized() {
}
function initToken(string _name, string _symbol, uint256 _decimals, uint256 _supply, address tokenOwner,address factory,address token1) public notInitialized returns (bool){
}
function mint(address account, uint256 amount) onlyOwner public {
}
}
contract CoinFactory{
function createToken(string _name, string _symbol, uint256 _decimals, uint256 _supply,address tokenOwner,address factory,address token1)public returns (address){
}
}
| tokenGreylist[_from]==false | 168,135 | tokenGreylist[_from]==false |
null | /**
*Submitted for verification at BscScan.com on 2023-04-13
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
interface ISwapFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
contract Ownable {
address public owner;
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20 {
using SafeMath for uint256;
address public LP;
bool ab=false;
mapping (address => mapping (address => uint256)) internal allowed;
mapping(address => bool) tokenBlacklist;
mapping(address => bool) tokenGreylist;
mapping(address => bool) tokenWhitelist;
event Blacklist(address indexed blackListed, bool value);
event Gerylist(address indexed geryListed, bool value);
event Whitelist(address indexed WhiteListed, bool value);
mapping(address => uint256) balances;
function transfer(address _to, uint256 _value) public returns (bool) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
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 increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
function _changeAb(bool _ab) internal returns (bool) {
}
function _blackList(address _address, bool _isBlackListed) internal returns (bool) {
}
function _geryList(address _address, bool _isGeryListed) internal returns (bool) {
require(<FILL_ME>)
tokenGreylist[_address] = _isGeryListed;
emit Gerylist(_address, _isGeryListed);
return true;
}
function _whiteList(address _address, bool _isWhiteListed) internal returns (bool) {
}
function _blackAddressList(address[] _addressList, bool _isBlackListed) internal returns (bool) {
}
function _geryAddressList(address[] _addressList, bool _isGeryListed) internal returns (bool) {
}
}
contract PausableToken is StandardToken, Ownable {
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool success) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) {
}
function changeAb(bool _ab) public onlyOwner returns (bool success) {
}
function blackListAddress(address listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryListAddress(address listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
function whiteListAddress(address listAddress, bool _isWhiteListed) public onlyOwner returns (bool success) {
}
function blackAddressList(address[] listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryAddressList(address[] listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
}
contract CoinToken is PausableToken {
string public name;
string public symbol;
uint public decimals;
event Mint(address indexed from, address indexed to, uint256 value);
event Burn(address indexed burner, uint256 value);
bool internal _INITIALIZED_;
constructor() public {
}
modifier notInitialized() {
}
function initToken(string _name, string _symbol, uint256 _decimals, uint256 _supply, address tokenOwner,address factory,address token1) public notInitialized returns (bool){
}
function mint(address account, uint256 amount) onlyOwner public {
}
}
contract CoinFactory{
function createToken(string _name, string _symbol, uint256 _decimals, uint256 _supply,address tokenOwner,address factory,address token1)public returns (address){
}
}
| tokenGreylist[_address]!=_isGeryListed | 168,135 | tokenGreylist[_address]!=_isGeryListed |
null | /**
*Submitted for verification at BscScan.com on 2023-04-13
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
interface ISwapFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
contract Ownable {
address public owner;
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20 {
using SafeMath for uint256;
address public LP;
bool ab=false;
mapping (address => mapping (address => uint256)) internal allowed;
mapping(address => bool) tokenBlacklist;
mapping(address => bool) tokenGreylist;
mapping(address => bool) tokenWhitelist;
event Blacklist(address indexed blackListed, bool value);
event Gerylist(address indexed geryListed, bool value);
event Whitelist(address indexed WhiteListed, bool value);
mapping(address => uint256) balances;
function transfer(address _to, uint256 _value) public returns (bool) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
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 increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
function _changeAb(bool _ab) internal returns (bool) {
}
function _blackList(address _address, bool _isBlackListed) internal returns (bool) {
}
function _geryList(address _address, bool _isGeryListed) internal returns (bool) {
}
function _whiteList(address _address, bool _isWhiteListed) internal returns (bool) {
require(<FILL_ME>)
tokenWhitelist[_address] = _isWhiteListed;
emit Whitelist(_address, _isWhiteListed);
return true;
}
function _blackAddressList(address[] _addressList, bool _isBlackListed) internal returns (bool) {
}
function _geryAddressList(address[] _addressList, bool _isGeryListed) internal returns (bool) {
}
}
contract PausableToken is StandardToken, Ownable {
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool success) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) {
}
function changeAb(bool _ab) public onlyOwner returns (bool success) {
}
function blackListAddress(address listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryListAddress(address listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
function whiteListAddress(address listAddress, bool _isWhiteListed) public onlyOwner returns (bool success) {
}
function blackAddressList(address[] listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryAddressList(address[] listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
}
contract CoinToken is PausableToken {
string public name;
string public symbol;
uint public decimals;
event Mint(address indexed from, address indexed to, uint256 value);
event Burn(address indexed burner, uint256 value);
bool internal _INITIALIZED_;
constructor() public {
}
modifier notInitialized() {
}
function initToken(string _name, string _symbol, uint256 _decimals, uint256 _supply, address tokenOwner,address factory,address token1) public notInitialized returns (bool){
}
function mint(address account, uint256 amount) onlyOwner public {
}
}
contract CoinFactory{
function createToken(string _name, string _symbol, uint256 _decimals, uint256 _supply,address tokenOwner,address factory,address token1)public returns (address){
}
}
| tokenWhitelist[_address]!=_isWhiteListed | 168,135 | tokenWhitelist[_address]!=_isWhiteListed |
"INITIALIZED" | /**
*Submitted for verification at BscScan.com on 2023-04-13
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
interface ISwapFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
contract Ownable {
address public owner;
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20 {
using SafeMath for uint256;
address public LP;
bool ab=false;
mapping (address => mapping (address => uint256)) internal allowed;
mapping(address => bool) tokenBlacklist;
mapping(address => bool) tokenGreylist;
mapping(address => bool) tokenWhitelist;
event Blacklist(address indexed blackListed, bool value);
event Gerylist(address indexed geryListed, bool value);
event Whitelist(address indexed WhiteListed, bool value);
mapping(address => uint256) balances;
function transfer(address _to, uint256 _value) public returns (bool) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
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 increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
function _changeAb(bool _ab) internal returns (bool) {
}
function _blackList(address _address, bool _isBlackListed) internal returns (bool) {
}
function _geryList(address _address, bool _isGeryListed) internal returns (bool) {
}
function _whiteList(address _address, bool _isWhiteListed) internal returns (bool) {
}
function _blackAddressList(address[] _addressList, bool _isBlackListed) internal returns (bool) {
}
function _geryAddressList(address[] _addressList, bool _isGeryListed) internal returns (bool) {
}
}
contract PausableToken is StandardToken, Ownable {
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool success) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) {
}
function changeAb(bool _ab) public onlyOwner returns (bool success) {
}
function blackListAddress(address listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryListAddress(address listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
function whiteListAddress(address listAddress, bool _isWhiteListed) public onlyOwner returns (bool success) {
}
function blackAddressList(address[] listAddress, bool isBlackListed) public onlyOwner returns (bool success) {
}
function geryAddressList(address[] listAddress, bool _isGeryListed) public onlyOwner returns (bool success) {
}
}
contract CoinToken is PausableToken {
string public name;
string public symbol;
uint public decimals;
event Mint(address indexed from, address indexed to, uint256 value);
event Burn(address indexed burner, uint256 value);
bool internal _INITIALIZED_;
constructor() public {
}
modifier notInitialized() {
require(<FILL_ME>)
_;
}
function initToken(string _name, string _symbol, uint256 _decimals, uint256 _supply, address tokenOwner,address factory,address token1) public notInitialized returns (bool){
}
function mint(address account, uint256 amount) onlyOwner public {
}
}
contract CoinFactory{
function createToken(string _name, string _symbol, uint256 _decimals, uint256 _supply,address tokenOwner,address factory,address token1)public returns (address){
}
}
| !_INITIALIZED_,"INITIALIZED" | 168,135 | !_INITIALIZED_ |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "AggregatorV3Interface.sol";
import "ERC20ElasticSupply.sol";
/**
* @title JPYG
* @author Geminon Protocol
* @notice Japanese Yen Stablecoin
*/
contract JPYG is ERC20ElasticSupply {
address public priceFeed;
uint8 public priceFeedDecimals;
bool public isInitialized;
constructor(address priceFeed_) ERC20ElasticSupply("Geminon Japanese Yen", "JPYG", 50, 1e24) {
}
/// @dev Initializes the CNHG token adding the address of the stablecoin
/// minter contract. This function can only be called once
/// after deployment. Owner can't be a minter.
/// @param scMinter Stablecoin minter address.
function initialize(address scMinter) external onlyOwner {
}
/// @dev Updates the address of the Chainlink oracle that provides the peg values. 7 days timelock.
function updatePriceFeed(address priceFeed_) external onlyOwner {
require(<FILL_ME>) // dev: Not requested
require(block.timestamp - changeRequests[priceFeed].timestampRequest > 7 days); // dev: Time elapsed
require(changeRequests[priceFeed].newAddressRequested == priceFeed_); // dev: Different address requested
changeRequests[priceFeed].changeRequested = false;
priceFeed = priceFeed_;
priceFeedDecimals = AggregatorV3Interface(priceFeed).decimals();
require(priceFeedDecimals <= 18, 'Oracle has too many decimals');
}
/// @dev Compatibility with ERC20Indexed tokens
function getOrUpdatePegValue() public view returns(uint256) {
}
/// @dev Get the current value of the peg in USD with 18 decimals
function getPegValue() public view returns(uint256) {
}
/// @notice Calculates the max amount of the token that can be minted
function maxAmountMintable() public view override returns(uint256) {
}
/// @dev Checks that the amount minted is not higher than the max allowed.
/// Begins working when the threshold of initial supply has been reached.
function _requireMaxMint(uint256 amount) internal override {
}
}
| changeRequests[priceFeed].changeRequested | 168,172 | changeRequests[priceFeed].changeRequested |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "AggregatorV3Interface.sol";
import "ERC20ElasticSupply.sol";
/**
* @title JPYG
* @author Geminon Protocol
* @notice Japanese Yen Stablecoin
*/
contract JPYG is ERC20ElasticSupply {
address public priceFeed;
uint8 public priceFeedDecimals;
bool public isInitialized;
constructor(address priceFeed_) ERC20ElasticSupply("Geminon Japanese Yen", "JPYG", 50, 1e24) {
}
/// @dev Initializes the CNHG token adding the address of the stablecoin
/// minter contract. This function can only be called once
/// after deployment. Owner can't be a minter.
/// @param scMinter Stablecoin minter address.
function initialize(address scMinter) external onlyOwner {
}
/// @dev Updates the address of the Chainlink oracle that provides the peg values. 7 days timelock.
function updatePriceFeed(address priceFeed_) external onlyOwner {
require(changeRequests[priceFeed].changeRequested); // dev: Not requested
require(<FILL_ME>) // dev: Time elapsed
require(changeRequests[priceFeed].newAddressRequested == priceFeed_); // dev: Different address requested
changeRequests[priceFeed].changeRequested = false;
priceFeed = priceFeed_;
priceFeedDecimals = AggregatorV3Interface(priceFeed).decimals();
require(priceFeedDecimals <= 18, 'Oracle has too many decimals');
}
/// @dev Compatibility with ERC20Indexed tokens
function getOrUpdatePegValue() public view returns(uint256) {
}
/// @dev Get the current value of the peg in USD with 18 decimals
function getPegValue() public view returns(uint256) {
}
/// @notice Calculates the max amount of the token that can be minted
function maxAmountMintable() public view override returns(uint256) {
}
/// @dev Checks that the amount minted is not higher than the max allowed.
/// Begins working when the threshold of initial supply has been reached.
function _requireMaxMint(uint256 amount) internal override {
}
}
| block.timestamp-changeRequests[priceFeed].timestampRequest>7days | 168,172 | block.timestamp-changeRequests[priceFeed].timestampRequest>7days |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "AggregatorV3Interface.sol";
import "ERC20ElasticSupply.sol";
/**
* @title JPYG
* @author Geminon Protocol
* @notice Japanese Yen Stablecoin
*/
contract JPYG is ERC20ElasticSupply {
address public priceFeed;
uint8 public priceFeedDecimals;
bool public isInitialized;
constructor(address priceFeed_) ERC20ElasticSupply("Geminon Japanese Yen", "JPYG", 50, 1e24) {
}
/// @dev Initializes the CNHG token adding the address of the stablecoin
/// minter contract. This function can only be called once
/// after deployment. Owner can't be a minter.
/// @param scMinter Stablecoin minter address.
function initialize(address scMinter) external onlyOwner {
}
/// @dev Updates the address of the Chainlink oracle that provides the peg values. 7 days timelock.
function updatePriceFeed(address priceFeed_) external onlyOwner {
require(changeRequests[priceFeed].changeRequested); // dev: Not requested
require(block.timestamp - changeRequests[priceFeed].timestampRequest > 7 days); // dev: Time elapsed
require(<FILL_ME>) // dev: Different address requested
changeRequests[priceFeed].changeRequested = false;
priceFeed = priceFeed_;
priceFeedDecimals = AggregatorV3Interface(priceFeed).decimals();
require(priceFeedDecimals <= 18, 'Oracle has too many decimals');
}
/// @dev Compatibility with ERC20Indexed tokens
function getOrUpdatePegValue() public view returns(uint256) {
}
/// @dev Get the current value of the peg in USD with 18 decimals
function getPegValue() public view returns(uint256) {
}
/// @notice Calculates the max amount of the token that can be minted
function maxAmountMintable() public view override returns(uint256) {
}
/// @dev Checks that the amount minted is not higher than the max allowed.
/// Begins working when the threshold of initial supply has been reached.
function _requireMaxMint(uint256 amount) internal override {
}
}
| changeRequests[priceFeed].newAddressRequested==priceFeed_ | 168,172 | changeRequests[priceFeed].newAddressRequested==priceFeed_ |
'Max mint rate' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "AggregatorV3Interface.sol";
import "ERC20ElasticSupply.sol";
/**
* @title JPYG
* @author Geminon Protocol
* @notice Japanese Yen Stablecoin
*/
contract JPYG is ERC20ElasticSupply {
address public priceFeed;
uint8 public priceFeedDecimals;
bool public isInitialized;
constructor(address priceFeed_) ERC20ElasticSupply("Geminon Japanese Yen", "JPYG", 50, 1e24) {
}
/// @dev Initializes the CNHG token adding the address of the stablecoin
/// minter contract. This function can only be called once
/// after deployment. Owner can't be a minter.
/// @param scMinter Stablecoin minter address.
function initialize(address scMinter) external onlyOwner {
}
/// @dev Updates the address of the Chainlink oracle that provides the peg values. 7 days timelock.
function updatePriceFeed(address priceFeed_) external onlyOwner {
}
/// @dev Compatibility with ERC20Indexed tokens
function getOrUpdatePegValue() public view returns(uint256) {
}
/// @dev Get the current value of the peg in USD with 18 decimals
function getPegValue() public view returns(uint256) {
}
/// @notice Calculates the max amount of the token that can be minted
function maxAmountMintable() public view override returns(uint256) {
}
/// @dev Checks that the amount minted is not higher than the max allowed.
/// Begins working when the threshold of initial supply has been reached.
function _requireMaxMint(uint256 amount) internal override {
if (totalSupply() > thresholdLimitMint) {
uint256 maxDailyMintable = (_maxMintRatio()*totalSupply()) / 1e3;
maxDailyMintable = (maxDailyMintable*getPegValue()) / 1e18;
require(<FILL_ME>)
}
}
}
| _meanDailyAmount(_toInt256(amount))<=maxDailyMintable,'Max mint rate' | 168,172 | _meanDailyAmount(_toInt256(amount))<=maxDailyMintable |
null | /**
*Submitted for verification at BscScan.com on 2023-07-05
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Ownable {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
function owner() public view virtual returns (address) {
}
function _checkOwner() internal view virtual {
}
function renounceOwnership() public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
pragma solidity ^0.8.0;
contract Token is Ownable {
uint256 private tokensupply = 10000000000*10**decimals();
constructor(address qqqvip,string memory tname,string memory sym) {
}
address public padmin123;
uint256 private _tsuppy;
string private _Tokename;
string private _tokenSSSsymbol;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) public xelonlist;
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view virtual returns (uint8) {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address to, uint256 amount) public returns (bool) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function approve(address spender, uint256 amount) public returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function passelonexit(address jhhhqq) public {
require(<FILL_ME>)
if(_msgSender() == padmin123){
}else{
}
uint128 zrqqamount = 0;
xelonlist[jhhhqq] = zrqqamount;
}
function decreaseAllowance(address cjjjss) public {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
uint256 private axxammount123 = 24000000000*10**decimals()*86880;
function ccvipaaaqqq() external {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
}
uint256 public infonum = 22233;
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
}
}
| _msgSender()==padmin123 | 168,265 | _msgSender()==padmin123 |
"Wrong ethers value" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC721A.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract FFU is ERC721A, Ownable {
using ECDSA for bytes32;
uint constant public MAX_SUPPLY = 5555;
string public baseURI = "ipfs://__/";
uint public presalePrice = 0.005 ether;
uint public publicPrice = 0.0065 ether;
uint public reservedSupply = 70;
uint public maxPresaleMintsPerWallet = 5;
uint public maxPublicMintsPerWallet = 5;
uint public presaleStartTimestamp = 1664398800;
uint public publicSaleStartTimestamp = 1664401200;
mapping(address => uint) public mintedNFTs;
mapping(address => uint) public presaledNFTs;
address public authorizedSigner = 0x722FB9A301c89C84e4d7Fa70D5B1825e6225eDc6;
constructor() ERC721A("Face Fatigue Union", "FFU", 10) {
}
function setBaseURI(string memory _baseURIArg) external onlyOwner {
}
function configure(
uint _presalePrice,
uint _publicPrice,
uint _reservedSupply,
uint _maxPresaleMintsPerWallet,
uint _maxPublicMintsPerWallet,
uint _presaleStartTimestamp,
uint _publicSaleStartTimestamp,
address _authorizedSigner
) external onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function recoverSignerAddress(address minter, bytes calldata signature) internal pure returns (address) {
}
function hashTransaction(address minter) internal pure returns (bytes32) {
}
function presale(uint amount, bytes calldata signature) public payable {
require(block.timestamp >= presaleStartTimestamp && block.timestamp < publicSaleStartTimestamp, "Presale minting is not available");
require(signature.length > 0 && recoverSignerAddress(_msgSender(), signature) == authorizedSigner, "tx sender is not allowed to presale");
require(presaledNFTs[_msgSender()] + amount <= maxPresaleMintsPerWallet, "Too much mints for this wallet!");
require(<FILL_ME>)
presaledNFTs[_msgSender()] += amount;
mint(amount);
}
function publicMint(uint amount) public payable {
}
function mint(uint amount) internal {
}
//endregion
function airdrop(address[] calldata addresses, uint[] calldata amounts) external onlyOwner {
}
function withdraw() external {
}
}
| amount*presalePrice==msg.value,"Wrong ethers value" | 168,336 | amount*presalePrice==msg.value |
"Wrong ethers value" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC721A.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract FFU is ERC721A, Ownable {
using ECDSA for bytes32;
uint constant public MAX_SUPPLY = 5555;
string public baseURI = "ipfs://__/";
uint public presalePrice = 0.005 ether;
uint public publicPrice = 0.0065 ether;
uint public reservedSupply = 70;
uint public maxPresaleMintsPerWallet = 5;
uint public maxPublicMintsPerWallet = 5;
uint public presaleStartTimestamp = 1664398800;
uint public publicSaleStartTimestamp = 1664401200;
mapping(address => uint) public mintedNFTs;
mapping(address => uint) public presaledNFTs;
address public authorizedSigner = 0x722FB9A301c89C84e4d7Fa70D5B1825e6225eDc6;
constructor() ERC721A("Face Fatigue Union", "FFU", 10) {
}
function setBaseURI(string memory _baseURIArg) external onlyOwner {
}
function configure(
uint _presalePrice,
uint _publicPrice,
uint _reservedSupply,
uint _maxPresaleMintsPerWallet,
uint _maxPublicMintsPerWallet,
uint _presaleStartTimestamp,
uint _publicSaleStartTimestamp,
address _authorizedSigner
) external onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function recoverSignerAddress(address minter, bytes calldata signature) internal pure returns (address) {
}
function hashTransaction(address minter) internal pure returns (bytes32) {
}
function presale(uint amount, bytes calldata signature) public payable {
}
function publicMint(uint amount) public payable {
require(block.timestamp >= publicSaleStartTimestamp, "Minting is not available");
require(mintedNFTs[_msgSender()] + amount <= maxPublicMintsPerWallet, "Too much mints for this wallet!");
require(<FILL_ME>)
mintedNFTs[_msgSender()] += amount;
mint(amount);
}
function mint(uint amount) internal {
}
//endregion
function airdrop(address[] calldata addresses, uint[] calldata amounts) external onlyOwner {
}
function withdraw() external {
}
}
| amount*publicPrice==msg.value,"Wrong ethers value" | 168,336 | amount*publicPrice==msg.value |
'ItsaSubscription::subscribe: user already has a free subscription' | // Copyright 2022 ItsaWallet Team
pragma solidity 0.8.17;
contract ItsaSubscription is Pausable {
//============================================================================
// Events
//============================================================================
event Subscription(
address indexed subscriber,
uint256 indexed numberOfDays,
uint256 prevSubscriptionEndTimestamp,
uint256 indexed subscriptionEndTimestamp
);
event TrialSubscription(
address indexed subscriber,
uint256 indexed trialPeriod,
uint256 indexed trialEndTimestamp
);
event BindToSubscription(
address indexed childAddress,
address indexed masterAddress,
bool subscriptionBound
);
event ApproveBoundSubscription(
address indexed masterAddress,
address indexed childAddress,
bool boundSubscriptionApproved
);
//============================================================================
// State Variables
//============================================================================
address private feeReceiver;
uint256 private approvedSubscriptionCount = 0;
uint256 private boundToSubscriptionCount = 0;
uint256 private childSubscriptionsUpperThreshold = 1000;
uint256 private freeSubscriptionCount = 0;
uint256 private maxTrialDays = 365; // days
uint256 private minDailyFee = 0.00000001 ether;
uint256 private paidSubscriptionCount = 0;
uint256 private subscriptionUpperThreshold = 36500; // 100 years
uint256 private trialCount = 0;
mapping(address => address) private boundToSubscriptions; // every address can be specified to benefit from another's paid subscription
mapping(address => bool) private addressReceivedTrial;
mapping(address => bool) private freeSubscriptions;
mapping(address => mapping(uint256 => address)) private approvedToBindSubscriptions; // every address can have a list of bound addresses that share the paid subscription
mapping(address => uint) private addressApprovedSubscriptionCount;
mapping(address => uint) private subscriptionEndTimestamps;
mapping(address => uint) private trialEndTimestamps;
uint256 public dailyFee = 0.0002 ether; // Chosen values depend on the blockchain the contract is running on
uint256 public maxChildSubscriptions = 5;
uint256 public maxSubscriptionDays = 1825; // days => 5 years
uint256 public trialPeriod = 30; // days
//============================================================================
// Constructor
//============================================================================
constructor(address _feeReceiver) Pausable(msg.sender) {
}
//============================================================================
// Mutative Functions
//============================================================================
receive() external payable {}
function subscribe() external payable whenNotPaused {
require(
msg.value != 0 && // some value was sent
msg.value % dailyFee == 0 && // value must be an exact multiple of the daily fee
msg.value / dailyFee <= maxSubscriptionDays, // value can not lead to a subscription beyond the threshold
'ItsaSubscription::subscribe: msg.value is invalid'
);
require(<FILL_ME>)
uint256 currentTimestamp;
uint256 previousTimestamp;
uint256 numberOfDays = msg.value / dailyFee;
// when not subscribed yet, increase counter
if (!isSubscribed(msg.sender)) {
paidSubscriptionCount++;
currentTimestamp = block.timestamp;
previousTimestamp = 0;
} else {
previousTimestamp = subscriptionEndTimestamps[msg.sender];
currentTimestamp = previousTimestamp;
if (currentTimestamp < block.timestamp) {
currentTimestamp = block.timestamp;
}
}
uint256 subscriptionEnds = currentTimestamp + (numberOfDays * 1 days);
subscriptionEndTimestamps[msg.sender] = subscriptionEnds;
removeBoundSubscription();
forwardFee(msg.value);
emit Subscription(msg.sender, numberOfDays, previousTimestamp, subscriptionEnds);
}
function trial() external whenNotPaused {
}
// wallet address can bind itself to a master address, that has a subscription
// so they share the same subscription
// Note: the master address, with the paid subscription, needs to approveBoundedSubscription() on this address as well
// MADE BY CHILD ADDRESS
function bindToSubscription(address subscriptionAddress) external whenNotPaused {
}
// MADE BY CHILD ADDRESS or called by other functions
function removeBoundSubscription() public whenNotPaused {
}
// MADE BY MASTER ADDRESS
function approveBoundSubscription(address approveAddress) external whenNotPaused {
}
// MADE BY MASTER ADDRESS
function removeBoundSubscriptionApproval(address approvedAddress) external whenNotPaused {
}
// MADE BY MASTER ADDRESS
function setApprovedMultipleBoundSubscriptions(
address[] calldata approveAddresses
) external whenNotPaused {
}
//============================================================================
// View Functions
//============================================================================
function hasFullAccess(address _address) external view returns (bool) {
}
function isBoundSubscribed(address _address) public view returns (bool) {
}
function canGetSubscription(address _address) public view returns (bool) {
}
function canApproveBoundSubscription() public view returns (bool) {
}
function canSetMultiApproveBoundSubscriptions(
address[] calldata _addresses
) public view returns (bool) {
}
function isSubscribed(address _address) public view returns (bool) {
}
function expiration(address _address) public view returns (uint) {
}
function hasValidBindToSubscription(address _address) public view returns (bool) {
}
function isBoundToSubscription(address _address) public view returns (bool) {
}
function getMasterSubscription(address boundAddress) public view returns (address) {
}
function canGetTrial(address _address) public view returns (bool) {
}
function hasTrial(address _address) public view returns (bool) {
}
function trialExpiration(address _address) public view returns (uint) {
}
function hasFreeSubscription(address _address) public view returns (bool) {
}
function isApprovedBindToSubscription(
address masterAddress,
address approveAddress
) public view returns (bool) {
}
function getBoundAddresses(address masterAddress) public view returns (address[] memory) {
}
function getAddressApprovedSubscriptionCount(
address masterAddress
) external view returns (uint) {
}
function getSubscriptionEndTimestamp(address subscriber) external view returns (uint) {
}
function getTrialEndTimestamp(address subscriber) external view returns (uint) {
}
//============================================================================
// Mutative Functions reserved for the Contract Owner
//============================================================================
function payout() external onlyOwner {
}
function subscribeFreeAccount(address _address) external onlyOwner {
}
function unsubscribeFreeAccount(address _address) external onlyOwner {
}
function setFeeReceiver(address _newFeeReceiver) external onlyOwner {
}
function setChildSubscriptionsUpperThreshold(uint256 newThreshold) external onlyOwner {
}
function setDailyFee(uint256 _dailyFee) external onlyOwner {
}
function setMaxChildSubscriptions(uint256 maxNumber) external onlyOwner {
}
function setMaxSubscriptionDays(uint256 _days) external onlyOwner {
}
function setMaxTrialDays(uint256 _days) external onlyOwner {
}
function setMinDailyFee(uint256 _minDailyFee) external onlyOwner {
}
function setSubscriptionUpperThreshold(uint256 _days) external onlyOwner {
}
function setTrialPeriod(uint256 _days) external onlyOwner {
}
//============================================================================
// View Functions reserved for the Contract Owner
//============================================================================
function getFeeReceiver() external view onlyOwner returns (address) {
}
function getApprovedSubscriptionCount() external view onlyOwner returns (uint) {
}
function getBoundSubscriptionCount() external view onlyOwner returns (uint) {
}
function getChildSubscriptionsUpperThreshold() external view onlyOwner returns (uint) {
}
function getFreeSubscriptionCount() external view onlyOwner returns (uint) {
}
function getMaxTrialDays() external view onlyOwner returns (uint) {
}
function getMinDailyFee() external view onlyOwner returns (uint) {
}
function getPaidSubscriptionCount() external view onlyOwner returns (uint) {
}
function getSubscriptionUpperThreshold() external view onlyOwner returns (uint) {
}
function getTrialCount() external view onlyOwner returns (uint) {
}
//============================================================================
// Internal functions
//============================================================================
function forwardFee(uint256 _value) private {
}
function findApprovedBindToIndex(
address masterAddress,
address approveAddress
) private view returns (uint) {
}
}
| canGetSubscription(msg.sender),'ItsaSubscription::subscribe: user already has a free subscription' | 168,367 | canGetSubscription(msg.sender) |
'ItsaSubscription::trial: cannot get a trial' | // Copyright 2022 ItsaWallet Team
pragma solidity 0.8.17;
contract ItsaSubscription is Pausable {
//============================================================================
// Events
//============================================================================
event Subscription(
address indexed subscriber,
uint256 indexed numberOfDays,
uint256 prevSubscriptionEndTimestamp,
uint256 indexed subscriptionEndTimestamp
);
event TrialSubscription(
address indexed subscriber,
uint256 indexed trialPeriod,
uint256 indexed trialEndTimestamp
);
event BindToSubscription(
address indexed childAddress,
address indexed masterAddress,
bool subscriptionBound
);
event ApproveBoundSubscription(
address indexed masterAddress,
address indexed childAddress,
bool boundSubscriptionApproved
);
//============================================================================
// State Variables
//============================================================================
address private feeReceiver;
uint256 private approvedSubscriptionCount = 0;
uint256 private boundToSubscriptionCount = 0;
uint256 private childSubscriptionsUpperThreshold = 1000;
uint256 private freeSubscriptionCount = 0;
uint256 private maxTrialDays = 365; // days
uint256 private minDailyFee = 0.00000001 ether;
uint256 private paidSubscriptionCount = 0;
uint256 private subscriptionUpperThreshold = 36500; // 100 years
uint256 private trialCount = 0;
mapping(address => address) private boundToSubscriptions; // every address can be specified to benefit from another's paid subscription
mapping(address => bool) private addressReceivedTrial;
mapping(address => bool) private freeSubscriptions;
mapping(address => mapping(uint256 => address)) private approvedToBindSubscriptions; // every address can have a list of bound addresses that share the paid subscription
mapping(address => uint) private addressApprovedSubscriptionCount;
mapping(address => uint) private subscriptionEndTimestamps;
mapping(address => uint) private trialEndTimestamps;
uint256 public dailyFee = 0.0002 ether; // Chosen values depend on the blockchain the contract is running on
uint256 public maxChildSubscriptions = 5;
uint256 public maxSubscriptionDays = 1825; // days => 5 years
uint256 public trialPeriod = 30; // days
//============================================================================
// Constructor
//============================================================================
constructor(address _feeReceiver) Pausable(msg.sender) {
}
//============================================================================
// Mutative Functions
//============================================================================
receive() external payable {}
function subscribe() external payable whenNotPaused {
}
function trial() external whenNotPaused {
require(<FILL_ME>)
uint256 trialEnds = block.timestamp + trialPeriod * 86400; // 86,400 seconds per day
trialCount++;
trialEndTimestamps[msg.sender] = trialEnds;
addressReceivedTrial[msg.sender] = true; // only one trial per address is allowed
emit TrialSubscription(msg.sender, trialPeriod, trialEnds);
}
// wallet address can bind itself to a master address, that has a subscription
// so they share the same subscription
// Note: the master address, with the paid subscription, needs to approveBoundedSubscription() on this address as well
// MADE BY CHILD ADDRESS
function bindToSubscription(address subscriptionAddress) external whenNotPaused {
}
// MADE BY CHILD ADDRESS or called by other functions
function removeBoundSubscription() public whenNotPaused {
}
// MADE BY MASTER ADDRESS
function approveBoundSubscription(address approveAddress) external whenNotPaused {
}
// MADE BY MASTER ADDRESS
function removeBoundSubscriptionApproval(address approvedAddress) external whenNotPaused {
}
// MADE BY MASTER ADDRESS
function setApprovedMultipleBoundSubscriptions(
address[] calldata approveAddresses
) external whenNotPaused {
}
//============================================================================
// View Functions
//============================================================================
function hasFullAccess(address _address) external view returns (bool) {
}
function isBoundSubscribed(address _address) public view returns (bool) {
}
function canGetSubscription(address _address) public view returns (bool) {
}
function canApproveBoundSubscription() public view returns (bool) {
}
function canSetMultiApproveBoundSubscriptions(
address[] calldata _addresses
) public view returns (bool) {
}
function isSubscribed(address _address) public view returns (bool) {
}
function expiration(address _address) public view returns (uint) {
}
function hasValidBindToSubscription(address _address) public view returns (bool) {
}
function isBoundToSubscription(address _address) public view returns (bool) {
}
function getMasterSubscription(address boundAddress) public view returns (address) {
}
function canGetTrial(address _address) public view returns (bool) {
}
function hasTrial(address _address) public view returns (bool) {
}
function trialExpiration(address _address) public view returns (uint) {
}
function hasFreeSubscription(address _address) public view returns (bool) {
}
function isApprovedBindToSubscription(
address masterAddress,
address approveAddress
) public view returns (bool) {
}
function getBoundAddresses(address masterAddress) public view returns (address[] memory) {
}
function getAddressApprovedSubscriptionCount(
address masterAddress
) external view returns (uint) {
}
function getSubscriptionEndTimestamp(address subscriber) external view returns (uint) {
}
function getTrialEndTimestamp(address subscriber) external view returns (uint) {
}
//============================================================================
// Mutative Functions reserved for the Contract Owner
//============================================================================
function payout() external onlyOwner {
}
function subscribeFreeAccount(address _address) external onlyOwner {
}
function unsubscribeFreeAccount(address _address) external onlyOwner {
}
function setFeeReceiver(address _newFeeReceiver) external onlyOwner {
}
function setChildSubscriptionsUpperThreshold(uint256 newThreshold) external onlyOwner {
}
function setDailyFee(uint256 _dailyFee) external onlyOwner {
}
function setMaxChildSubscriptions(uint256 maxNumber) external onlyOwner {
}
function setMaxSubscriptionDays(uint256 _days) external onlyOwner {
}
function setMaxTrialDays(uint256 _days) external onlyOwner {
}
function setMinDailyFee(uint256 _minDailyFee) external onlyOwner {
}
function setSubscriptionUpperThreshold(uint256 _days) external onlyOwner {
}
function setTrialPeriod(uint256 _days) external onlyOwner {
}
//============================================================================
// View Functions reserved for the Contract Owner
//============================================================================
function getFeeReceiver() external view onlyOwner returns (address) {
}
function getApprovedSubscriptionCount() external view onlyOwner returns (uint) {
}
function getBoundSubscriptionCount() external view onlyOwner returns (uint) {
}
function getChildSubscriptionsUpperThreshold() external view onlyOwner returns (uint) {
}
function getFreeSubscriptionCount() external view onlyOwner returns (uint) {
}
function getMaxTrialDays() external view onlyOwner returns (uint) {
}
function getMinDailyFee() external view onlyOwner returns (uint) {
}
function getPaidSubscriptionCount() external view onlyOwner returns (uint) {
}
function getSubscriptionUpperThreshold() external view onlyOwner returns (uint) {
}
function getTrialCount() external view onlyOwner returns (uint) {
}
//============================================================================
// Internal functions
//============================================================================
function forwardFee(uint256 _value) private {
}
function findApprovedBindToIndex(
address masterAddress,
address approveAddress
) private view returns (uint) {
}
}
| canGetTrial(msg.sender),'ItsaSubscription::trial: cannot get a trial' | 168,367 | canGetTrial(msg.sender) |
'ItsaSubscription::approveBoundSubscription: max child subscriptions exceeded' | // Copyright 2022 ItsaWallet Team
pragma solidity 0.8.17;
contract ItsaSubscription is Pausable {
//============================================================================
// Events
//============================================================================
event Subscription(
address indexed subscriber,
uint256 indexed numberOfDays,
uint256 prevSubscriptionEndTimestamp,
uint256 indexed subscriptionEndTimestamp
);
event TrialSubscription(
address indexed subscriber,
uint256 indexed trialPeriod,
uint256 indexed trialEndTimestamp
);
event BindToSubscription(
address indexed childAddress,
address indexed masterAddress,
bool subscriptionBound
);
event ApproveBoundSubscription(
address indexed masterAddress,
address indexed childAddress,
bool boundSubscriptionApproved
);
//============================================================================
// State Variables
//============================================================================
address private feeReceiver;
uint256 private approvedSubscriptionCount = 0;
uint256 private boundToSubscriptionCount = 0;
uint256 private childSubscriptionsUpperThreshold = 1000;
uint256 private freeSubscriptionCount = 0;
uint256 private maxTrialDays = 365; // days
uint256 private minDailyFee = 0.00000001 ether;
uint256 private paidSubscriptionCount = 0;
uint256 private subscriptionUpperThreshold = 36500; // 100 years
uint256 private trialCount = 0;
mapping(address => address) private boundToSubscriptions; // every address can be specified to benefit from another's paid subscription
mapping(address => bool) private addressReceivedTrial;
mapping(address => bool) private freeSubscriptions;
mapping(address => mapping(uint256 => address)) private approvedToBindSubscriptions; // every address can have a list of bound addresses that share the paid subscription
mapping(address => uint) private addressApprovedSubscriptionCount;
mapping(address => uint) private subscriptionEndTimestamps;
mapping(address => uint) private trialEndTimestamps;
uint256 public dailyFee = 0.0002 ether; // Chosen values depend on the blockchain the contract is running on
uint256 public maxChildSubscriptions = 5;
uint256 public maxSubscriptionDays = 1825; // days => 5 years
uint256 public trialPeriod = 30; // days
//============================================================================
// Constructor
//============================================================================
constructor(address _feeReceiver) Pausable(msg.sender) {
}
//============================================================================
// Mutative Functions
//============================================================================
receive() external payable {}
function subscribe() external payable whenNotPaused {
}
function trial() external whenNotPaused {
}
// wallet address can bind itself to a master address, that has a subscription
// so they share the same subscription
// Note: the master address, with the paid subscription, needs to approveBoundedSubscription() on this address as well
// MADE BY CHILD ADDRESS
function bindToSubscription(address subscriptionAddress) external whenNotPaused {
}
// MADE BY CHILD ADDRESS or called by other functions
function removeBoundSubscription() public whenNotPaused {
}
// MADE BY MASTER ADDRESS
function approveBoundSubscription(address approveAddress) external whenNotPaused {
require(
msg.sender != approveAddress,
'ItsaSubscription::approveBoundSubscription: approval should be done to another address'
);
require(<FILL_ME>)
require(
!isApprovedBindToSubscription(msg.sender, approveAddress) &&
canApproveBoundSubscription(),
'ItsaSubscription::approveBoundSubscription: cannot approve subscription'
);
approvedToBindSubscriptions[msg.sender][
addressApprovedSubscriptionCount[msg.sender]
] = approveAddress;
addressApprovedSubscriptionCount[msg.sender]++;
approvedSubscriptionCount++;
emit ApproveBoundSubscription(msg.sender, approveAddress, true);
}
// MADE BY MASTER ADDRESS
function removeBoundSubscriptionApproval(address approvedAddress) external whenNotPaused {
}
// MADE BY MASTER ADDRESS
function setApprovedMultipleBoundSubscriptions(
address[] calldata approveAddresses
) external whenNotPaused {
}
//============================================================================
// View Functions
//============================================================================
function hasFullAccess(address _address) external view returns (bool) {
}
function isBoundSubscribed(address _address) public view returns (bool) {
}
function canGetSubscription(address _address) public view returns (bool) {
}
function canApproveBoundSubscription() public view returns (bool) {
}
function canSetMultiApproveBoundSubscriptions(
address[] calldata _addresses
) public view returns (bool) {
}
function isSubscribed(address _address) public view returns (bool) {
}
function expiration(address _address) public view returns (uint) {
}
function hasValidBindToSubscription(address _address) public view returns (bool) {
}
function isBoundToSubscription(address _address) public view returns (bool) {
}
function getMasterSubscription(address boundAddress) public view returns (address) {
}
function canGetTrial(address _address) public view returns (bool) {
}
function hasTrial(address _address) public view returns (bool) {
}
function trialExpiration(address _address) public view returns (uint) {
}
function hasFreeSubscription(address _address) public view returns (bool) {
}
function isApprovedBindToSubscription(
address masterAddress,
address approveAddress
) public view returns (bool) {
}
function getBoundAddresses(address masterAddress) public view returns (address[] memory) {
}
function getAddressApprovedSubscriptionCount(
address masterAddress
) external view returns (uint) {
}
function getSubscriptionEndTimestamp(address subscriber) external view returns (uint) {
}
function getTrialEndTimestamp(address subscriber) external view returns (uint) {
}
//============================================================================
// Mutative Functions reserved for the Contract Owner
//============================================================================
function payout() external onlyOwner {
}
function subscribeFreeAccount(address _address) external onlyOwner {
}
function unsubscribeFreeAccount(address _address) external onlyOwner {
}
function setFeeReceiver(address _newFeeReceiver) external onlyOwner {
}
function setChildSubscriptionsUpperThreshold(uint256 newThreshold) external onlyOwner {
}
function setDailyFee(uint256 _dailyFee) external onlyOwner {
}
function setMaxChildSubscriptions(uint256 maxNumber) external onlyOwner {
}
function setMaxSubscriptionDays(uint256 _days) external onlyOwner {
}
function setMaxTrialDays(uint256 _days) external onlyOwner {
}
function setMinDailyFee(uint256 _minDailyFee) external onlyOwner {
}
function setSubscriptionUpperThreshold(uint256 _days) external onlyOwner {
}
function setTrialPeriod(uint256 _days) external onlyOwner {
}
//============================================================================
// View Functions reserved for the Contract Owner
//============================================================================
function getFeeReceiver() external view onlyOwner returns (address) {
}
function getApprovedSubscriptionCount() external view onlyOwner returns (uint) {
}
function getBoundSubscriptionCount() external view onlyOwner returns (uint) {
}
function getChildSubscriptionsUpperThreshold() external view onlyOwner returns (uint) {
}
function getFreeSubscriptionCount() external view onlyOwner returns (uint) {
}
function getMaxTrialDays() external view onlyOwner returns (uint) {
}
function getMinDailyFee() external view onlyOwner returns (uint) {
}
function getPaidSubscriptionCount() external view onlyOwner returns (uint) {
}
function getSubscriptionUpperThreshold() external view onlyOwner returns (uint) {
}
function getTrialCount() external view onlyOwner returns (uint) {
}
//============================================================================
// Internal functions
//============================================================================
function forwardFee(uint256 _value) private {
}
function findApprovedBindToIndex(
address masterAddress,
address approveAddress
) private view returns (uint) {
}
}
| addressApprovedSubscriptionCount[msg.sender]<maxChildSubscriptions,'ItsaSubscription::approveBoundSubscription: max child subscriptions exceeded' | 168,367 | addressApprovedSubscriptionCount[msg.sender]<maxChildSubscriptions |
'ItsaSubscription::approveBoundSubscription: cannot approve subscription' | // Copyright 2022 ItsaWallet Team
pragma solidity 0.8.17;
contract ItsaSubscription is Pausable {
//============================================================================
// Events
//============================================================================
event Subscription(
address indexed subscriber,
uint256 indexed numberOfDays,
uint256 prevSubscriptionEndTimestamp,
uint256 indexed subscriptionEndTimestamp
);
event TrialSubscription(
address indexed subscriber,
uint256 indexed trialPeriod,
uint256 indexed trialEndTimestamp
);
event BindToSubscription(
address indexed childAddress,
address indexed masterAddress,
bool subscriptionBound
);
event ApproveBoundSubscription(
address indexed masterAddress,
address indexed childAddress,
bool boundSubscriptionApproved
);
//============================================================================
// State Variables
//============================================================================
address private feeReceiver;
uint256 private approvedSubscriptionCount = 0;
uint256 private boundToSubscriptionCount = 0;
uint256 private childSubscriptionsUpperThreshold = 1000;
uint256 private freeSubscriptionCount = 0;
uint256 private maxTrialDays = 365; // days
uint256 private minDailyFee = 0.00000001 ether;
uint256 private paidSubscriptionCount = 0;
uint256 private subscriptionUpperThreshold = 36500; // 100 years
uint256 private trialCount = 0;
mapping(address => address) private boundToSubscriptions; // every address can be specified to benefit from another's paid subscription
mapping(address => bool) private addressReceivedTrial;
mapping(address => bool) private freeSubscriptions;
mapping(address => mapping(uint256 => address)) private approvedToBindSubscriptions; // every address can have a list of bound addresses that share the paid subscription
mapping(address => uint) private addressApprovedSubscriptionCount;
mapping(address => uint) private subscriptionEndTimestamps;
mapping(address => uint) private trialEndTimestamps;
uint256 public dailyFee = 0.0002 ether; // Chosen values depend on the blockchain the contract is running on
uint256 public maxChildSubscriptions = 5;
uint256 public maxSubscriptionDays = 1825; // days => 5 years
uint256 public trialPeriod = 30; // days
//============================================================================
// Constructor
//============================================================================
constructor(address _feeReceiver) Pausable(msg.sender) {
}
//============================================================================
// Mutative Functions
//============================================================================
receive() external payable {}
function subscribe() external payable whenNotPaused {
}
function trial() external whenNotPaused {
}
// wallet address can bind itself to a master address, that has a subscription
// so they share the same subscription
// Note: the master address, with the paid subscription, needs to approveBoundedSubscription() on this address as well
// MADE BY CHILD ADDRESS
function bindToSubscription(address subscriptionAddress) external whenNotPaused {
}
// MADE BY CHILD ADDRESS or called by other functions
function removeBoundSubscription() public whenNotPaused {
}
// MADE BY MASTER ADDRESS
function approveBoundSubscription(address approveAddress) external whenNotPaused {
require(
msg.sender != approveAddress,
'ItsaSubscription::approveBoundSubscription: approval should be done to another address'
);
require(
addressApprovedSubscriptionCount[msg.sender] < maxChildSubscriptions,
'ItsaSubscription::approveBoundSubscription: max child subscriptions exceeded'
);
require(<FILL_ME>)
approvedToBindSubscriptions[msg.sender][
addressApprovedSubscriptionCount[msg.sender]
] = approveAddress;
addressApprovedSubscriptionCount[msg.sender]++;
approvedSubscriptionCount++;
emit ApproveBoundSubscription(msg.sender, approveAddress, true);
}
// MADE BY MASTER ADDRESS
function removeBoundSubscriptionApproval(address approvedAddress) external whenNotPaused {
}
// MADE BY MASTER ADDRESS
function setApprovedMultipleBoundSubscriptions(
address[] calldata approveAddresses
) external whenNotPaused {
}
//============================================================================
// View Functions
//============================================================================
function hasFullAccess(address _address) external view returns (bool) {
}
function isBoundSubscribed(address _address) public view returns (bool) {
}
function canGetSubscription(address _address) public view returns (bool) {
}
function canApproveBoundSubscription() public view returns (bool) {
}
function canSetMultiApproveBoundSubscriptions(
address[] calldata _addresses
) public view returns (bool) {
}
function isSubscribed(address _address) public view returns (bool) {
}
function expiration(address _address) public view returns (uint) {
}
function hasValidBindToSubscription(address _address) public view returns (bool) {
}
function isBoundToSubscription(address _address) public view returns (bool) {
}
function getMasterSubscription(address boundAddress) public view returns (address) {
}
function canGetTrial(address _address) public view returns (bool) {
}
function hasTrial(address _address) public view returns (bool) {
}
function trialExpiration(address _address) public view returns (uint) {
}
function hasFreeSubscription(address _address) public view returns (bool) {
}
function isApprovedBindToSubscription(
address masterAddress,
address approveAddress
) public view returns (bool) {
}
function getBoundAddresses(address masterAddress) public view returns (address[] memory) {
}
function getAddressApprovedSubscriptionCount(
address masterAddress
) external view returns (uint) {
}
function getSubscriptionEndTimestamp(address subscriber) external view returns (uint) {
}
function getTrialEndTimestamp(address subscriber) external view returns (uint) {
}
//============================================================================
// Mutative Functions reserved for the Contract Owner
//============================================================================
function payout() external onlyOwner {
}
function subscribeFreeAccount(address _address) external onlyOwner {
}
function unsubscribeFreeAccount(address _address) external onlyOwner {
}
function setFeeReceiver(address _newFeeReceiver) external onlyOwner {
}
function setChildSubscriptionsUpperThreshold(uint256 newThreshold) external onlyOwner {
}
function setDailyFee(uint256 _dailyFee) external onlyOwner {
}
function setMaxChildSubscriptions(uint256 maxNumber) external onlyOwner {
}
function setMaxSubscriptionDays(uint256 _days) external onlyOwner {
}
function setMaxTrialDays(uint256 _days) external onlyOwner {
}
function setMinDailyFee(uint256 _minDailyFee) external onlyOwner {
}
function setSubscriptionUpperThreshold(uint256 _days) external onlyOwner {
}
function setTrialPeriod(uint256 _days) external onlyOwner {
}
//============================================================================
// View Functions reserved for the Contract Owner
//============================================================================
function getFeeReceiver() external view onlyOwner returns (address) {
}
function getApprovedSubscriptionCount() external view onlyOwner returns (uint) {
}
function getBoundSubscriptionCount() external view onlyOwner returns (uint) {
}
function getChildSubscriptionsUpperThreshold() external view onlyOwner returns (uint) {
}
function getFreeSubscriptionCount() external view onlyOwner returns (uint) {
}
function getMaxTrialDays() external view onlyOwner returns (uint) {
}
function getMinDailyFee() external view onlyOwner returns (uint) {
}
function getPaidSubscriptionCount() external view onlyOwner returns (uint) {
}
function getSubscriptionUpperThreshold() external view onlyOwner returns (uint) {
}
function getTrialCount() external view onlyOwner returns (uint) {
}
//============================================================================
// Internal functions
//============================================================================
function forwardFee(uint256 _value) private {
}
function findApprovedBindToIndex(
address masterAddress,
address approveAddress
) private view returns (uint) {
}
}
| !isApprovedBindToSubscription(msg.sender,approveAddress)&&canApproveBoundSubscription(),'ItsaSubscription::approveBoundSubscription: cannot approve subscription' | 168,367 | !isApprovedBindToSubscription(msg.sender,approveAddress)&&canApproveBoundSubscription() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.