comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
null | pragma solidity ^0.5.0;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(<FILL_ME>)
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| c/a==b | 203 | c/a==b |
null | contract ModultradeProposal is OracleOwnable, ContractReceiver {
address public seller;
address public buyer;
uint public id;
string public title;
uint public price;
ModultradeLibrary.Currencies public currency;
uint public units;
uint public total;
uint public validUntil;
ModultradeLibrary.ProposalStates public state;
uint public payDate;
string public deliveryId;
uint public fee;
address public feeAddress;
ERC20 mtrContract;
Modultrade modultrade;
bytes public tokenFallbackData;
event CreatedEvent(uint _id, ModultradeLibrary.ProposalStates _state);
event PaidEvent(uint _id, ModultradeLibrary.ProposalStates _state, address _buyer);
event DeliveryEvent(uint _id, ModultradeLibrary.ProposalStates _state, string _deliveryId);
event ClosedEvent(uint _id, ModultradeLibrary.ProposalStates _state, address _seller, uint _amount);
event CanceledEvent(uint _id, ModultradeLibrary.ProposalStates _state, address _buyer, uint _amount);
function ModultradeProposal(address _modultrade, address _seller, address _mtrContractAddress) public {
}
function setProposal(uint _id,
string _title,
uint _price,
ModultradeLibrary.Currencies _currency,
uint _units,
uint _total,
uint _validUntil
) public onlyOracleOrOwner {
}
function setFee(uint _fee, address _feeAddress) public onlyOracleOrOwner {
}
function() public payable { }
function purchase() public payable {
}
function setPaid(address _buyer) internal {
}
function paid(address _buyer) public onlyOracleOrOwner {
require(<FILL_ME>)
setPaid(_buyer);
}
function mtrTokenFallBack(address from, uint value) internal {
}
function tokenFallback(address from, uint value) public {
}
function tokenFallback(address from, uint value, bytes data) public {
}
function delivery(string _deliveryId) public onlyOracleOrOwner {
}
function close() public onlyOracleOrOwner {
}
function closeEth() private {
}
function closeMtr() private {
}
function cancel(uint cancelFee) public onlyOracleOrOwner {
}
function cancelEth(uint cancelFee) private {
}
function cancelMtr(uint cancelFee) private {
}
function getBalance() public constant returns (uint) {
}
}
| getBalance()>=total | 245 | getBalance()>=total |
"Org: Must provide claimId" | // SPDX-License-Identifier: BSD 3-Clause
pragma solidity ^0.6.10;
pragma experimental ABIEncoderV2;
import "./Administratable.sol";
import "./interfaces/IFactory.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
//ORG CONTRACT
/**
* @title Org
* @author rheeger
* @notice Org is a contract that serves as a smart wallet for US nonprofit
* organizations. It holds the organization's federal Tax ID number as taxID,
* and allows for an address to submit a Claim struct to the contract whereby
* the organization can directly receive grant awards from Endaoment Funds.
*/
contract Org is Initializable, Administratable {
using SafeERC20 for IERC20;
// ========== STRUCTS & EVENTS ==========
struct Claim {
string firstName;
string lastName;
string eMail;
address desiredWallet;
}
event CashOutComplete(uint256 cashOutAmount);
event ClaimCreated(string claimId, Claim claim);
event ClaimApproved(string claimId, Claim claim);
event ClaimRejected(string claimId, Claim claim);
// ========== STATE VARIABLES ==========
IFactory public orgFactoryContract;
uint256 public taxId;
mapping(string => Claim) public pendingClaims; // claim UUID to Claim
Claim public activeClaim;
// ========== CONSTRUCTOR ==========
/**
* @notice Create new Organization Contract
* @dev Using initializer instead of constructor for minimal proxy support. This function
* can only be called once in the contract's lifetime
* @param ein The U.S. Tax Identification Number for the Organization
* @param orgFactory Address of the Factory contract.
*/
function initializeOrg(uint256 ein, address orgFactory) public initializer {
}
// ========== Org Management & Info ==========
/**
* @notice Creates Organization Claim and emits a `ClaimCreated` event
* @param claimId UUID representing this claim
* @param fName First name of Administrator
* @param lName Last name of Administrator
* @param eMail Email contact for Organization Administrator.
* @param orgAdminWalletAddress Wallet address of Organization's Administrator.
*/
function claimRequest(
string calldata claimId,
string calldata fName,
string calldata lName,
string calldata eMail,
address orgAdminWalletAddress
) public {
require(<FILL_ME>)
require(!isEqual(fName, ""), "Org: Must provide the first name of the administrator");
require(!isEqual(lName, ""), "Org: Must provide the last name of the administrator");
require(!isEqual(eMail, ""), "Org: Must provide the email address of the administrator");
require(orgAdminWalletAddress != address(0), "Org: Wallet address cannot be the zero address");
require(
pendingClaims[claimId].desiredWallet == address(0),
"Org: Pending Claim with Id already exists"
);
Claim memory newClaim = Claim({
firstName: fName,
lastName: lName,
eMail: eMail,
desiredWallet: orgAdminWalletAddress
});
emit ClaimCreated(claimId, newClaim);
pendingClaims[claimId] = newClaim;
}
/**
* @notice Approves an Organization Claim and emits a `ClaimApproved` event
* @param claimId UUID of the claim being approved
*/
function approveClaim(string calldata claimId)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.REVIEWER)
{
}
/**
* @notice Rejects an Organization Claim and emits a 'ClaimRejected` event
* @param claimId UUID of the claim being rejected
*/
function rejectClaim(string calldata claimId)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.REVIEWER)
{
}
/**
* @notice Cashes out Organization Contract and emits a `CashOutComplete` event
* @param tokenAddress ERC20 address of desired token withdrawal
*/
function cashOutOrg(address tokenAddress)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.ACCOUNTANT)
{
}
/**
* @notice Retrieves Token Balance of Org Contract
* @param tokenAddress Address of desired token to query for balance
* @return Balance of conract in token base unit of provided tokenAddress
*/
function getTokenBalance(address tokenAddress) external view returns (uint256) {
}
/**
* @notice Org Wallet convenience accessor
* @return The wallet specified in the active, approved claim
*/
function orgWallet() public view returns (address) {
}
}
| !isEqual(claimId,""),"Org: Must provide claimId" | 377 | !isEqual(claimId,"") |
"Org: Must provide the first name of the administrator" | // SPDX-License-Identifier: BSD 3-Clause
pragma solidity ^0.6.10;
pragma experimental ABIEncoderV2;
import "./Administratable.sol";
import "./interfaces/IFactory.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
//ORG CONTRACT
/**
* @title Org
* @author rheeger
* @notice Org is a contract that serves as a smart wallet for US nonprofit
* organizations. It holds the organization's federal Tax ID number as taxID,
* and allows for an address to submit a Claim struct to the contract whereby
* the organization can directly receive grant awards from Endaoment Funds.
*/
contract Org is Initializable, Administratable {
using SafeERC20 for IERC20;
// ========== STRUCTS & EVENTS ==========
struct Claim {
string firstName;
string lastName;
string eMail;
address desiredWallet;
}
event CashOutComplete(uint256 cashOutAmount);
event ClaimCreated(string claimId, Claim claim);
event ClaimApproved(string claimId, Claim claim);
event ClaimRejected(string claimId, Claim claim);
// ========== STATE VARIABLES ==========
IFactory public orgFactoryContract;
uint256 public taxId;
mapping(string => Claim) public pendingClaims; // claim UUID to Claim
Claim public activeClaim;
// ========== CONSTRUCTOR ==========
/**
* @notice Create new Organization Contract
* @dev Using initializer instead of constructor for minimal proxy support. This function
* can only be called once in the contract's lifetime
* @param ein The U.S. Tax Identification Number for the Organization
* @param orgFactory Address of the Factory contract.
*/
function initializeOrg(uint256 ein, address orgFactory) public initializer {
}
// ========== Org Management & Info ==========
/**
* @notice Creates Organization Claim and emits a `ClaimCreated` event
* @param claimId UUID representing this claim
* @param fName First name of Administrator
* @param lName Last name of Administrator
* @param eMail Email contact for Organization Administrator.
* @param orgAdminWalletAddress Wallet address of Organization's Administrator.
*/
function claimRequest(
string calldata claimId,
string calldata fName,
string calldata lName,
string calldata eMail,
address orgAdminWalletAddress
) public {
require(!isEqual(claimId, ""), "Org: Must provide claimId");
require(<FILL_ME>)
require(!isEqual(lName, ""), "Org: Must provide the last name of the administrator");
require(!isEqual(eMail, ""), "Org: Must provide the email address of the administrator");
require(orgAdminWalletAddress != address(0), "Org: Wallet address cannot be the zero address");
require(
pendingClaims[claimId].desiredWallet == address(0),
"Org: Pending Claim with Id already exists"
);
Claim memory newClaim = Claim({
firstName: fName,
lastName: lName,
eMail: eMail,
desiredWallet: orgAdminWalletAddress
});
emit ClaimCreated(claimId, newClaim);
pendingClaims[claimId] = newClaim;
}
/**
* @notice Approves an Organization Claim and emits a `ClaimApproved` event
* @param claimId UUID of the claim being approved
*/
function approveClaim(string calldata claimId)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.REVIEWER)
{
}
/**
* @notice Rejects an Organization Claim and emits a 'ClaimRejected` event
* @param claimId UUID of the claim being rejected
*/
function rejectClaim(string calldata claimId)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.REVIEWER)
{
}
/**
* @notice Cashes out Organization Contract and emits a `CashOutComplete` event
* @param tokenAddress ERC20 address of desired token withdrawal
*/
function cashOutOrg(address tokenAddress)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.ACCOUNTANT)
{
}
/**
* @notice Retrieves Token Balance of Org Contract
* @param tokenAddress Address of desired token to query for balance
* @return Balance of conract in token base unit of provided tokenAddress
*/
function getTokenBalance(address tokenAddress) external view returns (uint256) {
}
/**
* @notice Org Wallet convenience accessor
* @return The wallet specified in the active, approved claim
*/
function orgWallet() public view returns (address) {
}
}
| !isEqual(fName,""),"Org: Must provide the first name of the administrator" | 377 | !isEqual(fName,"") |
"Org: Must provide the last name of the administrator" | // SPDX-License-Identifier: BSD 3-Clause
pragma solidity ^0.6.10;
pragma experimental ABIEncoderV2;
import "./Administratable.sol";
import "./interfaces/IFactory.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
//ORG CONTRACT
/**
* @title Org
* @author rheeger
* @notice Org is a contract that serves as a smart wallet for US nonprofit
* organizations. It holds the organization's federal Tax ID number as taxID,
* and allows for an address to submit a Claim struct to the contract whereby
* the organization can directly receive grant awards from Endaoment Funds.
*/
contract Org is Initializable, Administratable {
using SafeERC20 for IERC20;
// ========== STRUCTS & EVENTS ==========
struct Claim {
string firstName;
string lastName;
string eMail;
address desiredWallet;
}
event CashOutComplete(uint256 cashOutAmount);
event ClaimCreated(string claimId, Claim claim);
event ClaimApproved(string claimId, Claim claim);
event ClaimRejected(string claimId, Claim claim);
// ========== STATE VARIABLES ==========
IFactory public orgFactoryContract;
uint256 public taxId;
mapping(string => Claim) public pendingClaims; // claim UUID to Claim
Claim public activeClaim;
// ========== CONSTRUCTOR ==========
/**
* @notice Create new Organization Contract
* @dev Using initializer instead of constructor for minimal proxy support. This function
* can only be called once in the contract's lifetime
* @param ein The U.S. Tax Identification Number for the Organization
* @param orgFactory Address of the Factory contract.
*/
function initializeOrg(uint256 ein, address orgFactory) public initializer {
}
// ========== Org Management & Info ==========
/**
* @notice Creates Organization Claim and emits a `ClaimCreated` event
* @param claimId UUID representing this claim
* @param fName First name of Administrator
* @param lName Last name of Administrator
* @param eMail Email contact for Organization Administrator.
* @param orgAdminWalletAddress Wallet address of Organization's Administrator.
*/
function claimRequest(
string calldata claimId,
string calldata fName,
string calldata lName,
string calldata eMail,
address orgAdminWalletAddress
) public {
require(!isEqual(claimId, ""), "Org: Must provide claimId");
require(!isEqual(fName, ""), "Org: Must provide the first name of the administrator");
require(<FILL_ME>)
require(!isEqual(eMail, ""), "Org: Must provide the email address of the administrator");
require(orgAdminWalletAddress != address(0), "Org: Wallet address cannot be the zero address");
require(
pendingClaims[claimId].desiredWallet == address(0),
"Org: Pending Claim with Id already exists"
);
Claim memory newClaim = Claim({
firstName: fName,
lastName: lName,
eMail: eMail,
desiredWallet: orgAdminWalletAddress
});
emit ClaimCreated(claimId, newClaim);
pendingClaims[claimId] = newClaim;
}
/**
* @notice Approves an Organization Claim and emits a `ClaimApproved` event
* @param claimId UUID of the claim being approved
*/
function approveClaim(string calldata claimId)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.REVIEWER)
{
}
/**
* @notice Rejects an Organization Claim and emits a 'ClaimRejected` event
* @param claimId UUID of the claim being rejected
*/
function rejectClaim(string calldata claimId)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.REVIEWER)
{
}
/**
* @notice Cashes out Organization Contract and emits a `CashOutComplete` event
* @param tokenAddress ERC20 address of desired token withdrawal
*/
function cashOutOrg(address tokenAddress)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.ACCOUNTANT)
{
}
/**
* @notice Retrieves Token Balance of Org Contract
* @param tokenAddress Address of desired token to query for balance
* @return Balance of conract in token base unit of provided tokenAddress
*/
function getTokenBalance(address tokenAddress) external view returns (uint256) {
}
/**
* @notice Org Wallet convenience accessor
* @return The wallet specified in the active, approved claim
*/
function orgWallet() public view returns (address) {
}
}
| !isEqual(lName,""),"Org: Must provide the last name of the administrator" | 377 | !isEqual(lName,"") |
"Org: Must provide the email address of the administrator" | // SPDX-License-Identifier: BSD 3-Clause
pragma solidity ^0.6.10;
pragma experimental ABIEncoderV2;
import "./Administratable.sol";
import "./interfaces/IFactory.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
//ORG CONTRACT
/**
* @title Org
* @author rheeger
* @notice Org is a contract that serves as a smart wallet for US nonprofit
* organizations. It holds the organization's federal Tax ID number as taxID,
* and allows for an address to submit a Claim struct to the contract whereby
* the organization can directly receive grant awards from Endaoment Funds.
*/
contract Org is Initializable, Administratable {
using SafeERC20 for IERC20;
// ========== STRUCTS & EVENTS ==========
struct Claim {
string firstName;
string lastName;
string eMail;
address desiredWallet;
}
event CashOutComplete(uint256 cashOutAmount);
event ClaimCreated(string claimId, Claim claim);
event ClaimApproved(string claimId, Claim claim);
event ClaimRejected(string claimId, Claim claim);
// ========== STATE VARIABLES ==========
IFactory public orgFactoryContract;
uint256 public taxId;
mapping(string => Claim) public pendingClaims; // claim UUID to Claim
Claim public activeClaim;
// ========== CONSTRUCTOR ==========
/**
* @notice Create new Organization Contract
* @dev Using initializer instead of constructor for minimal proxy support. This function
* can only be called once in the contract's lifetime
* @param ein The U.S. Tax Identification Number for the Organization
* @param orgFactory Address of the Factory contract.
*/
function initializeOrg(uint256 ein, address orgFactory) public initializer {
}
// ========== Org Management & Info ==========
/**
* @notice Creates Organization Claim and emits a `ClaimCreated` event
* @param claimId UUID representing this claim
* @param fName First name of Administrator
* @param lName Last name of Administrator
* @param eMail Email contact for Organization Administrator.
* @param orgAdminWalletAddress Wallet address of Organization's Administrator.
*/
function claimRequest(
string calldata claimId,
string calldata fName,
string calldata lName,
string calldata eMail,
address orgAdminWalletAddress
) public {
require(!isEqual(claimId, ""), "Org: Must provide claimId");
require(!isEqual(fName, ""), "Org: Must provide the first name of the administrator");
require(!isEqual(lName, ""), "Org: Must provide the last name of the administrator");
require(<FILL_ME>)
require(orgAdminWalletAddress != address(0), "Org: Wallet address cannot be the zero address");
require(
pendingClaims[claimId].desiredWallet == address(0),
"Org: Pending Claim with Id already exists"
);
Claim memory newClaim = Claim({
firstName: fName,
lastName: lName,
eMail: eMail,
desiredWallet: orgAdminWalletAddress
});
emit ClaimCreated(claimId, newClaim);
pendingClaims[claimId] = newClaim;
}
/**
* @notice Approves an Organization Claim and emits a `ClaimApproved` event
* @param claimId UUID of the claim being approved
*/
function approveClaim(string calldata claimId)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.REVIEWER)
{
}
/**
* @notice Rejects an Organization Claim and emits a 'ClaimRejected` event
* @param claimId UUID of the claim being rejected
*/
function rejectClaim(string calldata claimId)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.REVIEWER)
{
}
/**
* @notice Cashes out Organization Contract and emits a `CashOutComplete` event
* @param tokenAddress ERC20 address of desired token withdrawal
*/
function cashOutOrg(address tokenAddress)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.ACCOUNTANT)
{
}
/**
* @notice Retrieves Token Balance of Org Contract
* @param tokenAddress Address of desired token to query for balance
* @return Balance of conract in token base unit of provided tokenAddress
*/
function getTokenBalance(address tokenAddress) external view returns (uint256) {
}
/**
* @notice Org Wallet convenience accessor
* @return The wallet specified in the active, approved claim
*/
function orgWallet() public view returns (address) {
}
}
| !isEqual(eMail,""),"Org: Must provide the email address of the administrator" | 377 | !isEqual(eMail,"") |
"Org: Pending Claim with Id already exists" | // SPDX-License-Identifier: BSD 3-Clause
pragma solidity ^0.6.10;
pragma experimental ABIEncoderV2;
import "./Administratable.sol";
import "./interfaces/IFactory.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
//ORG CONTRACT
/**
* @title Org
* @author rheeger
* @notice Org is a contract that serves as a smart wallet for US nonprofit
* organizations. It holds the organization's federal Tax ID number as taxID,
* and allows for an address to submit a Claim struct to the contract whereby
* the organization can directly receive grant awards from Endaoment Funds.
*/
contract Org is Initializable, Administratable {
using SafeERC20 for IERC20;
// ========== STRUCTS & EVENTS ==========
struct Claim {
string firstName;
string lastName;
string eMail;
address desiredWallet;
}
event CashOutComplete(uint256 cashOutAmount);
event ClaimCreated(string claimId, Claim claim);
event ClaimApproved(string claimId, Claim claim);
event ClaimRejected(string claimId, Claim claim);
// ========== STATE VARIABLES ==========
IFactory public orgFactoryContract;
uint256 public taxId;
mapping(string => Claim) public pendingClaims; // claim UUID to Claim
Claim public activeClaim;
// ========== CONSTRUCTOR ==========
/**
* @notice Create new Organization Contract
* @dev Using initializer instead of constructor for minimal proxy support. This function
* can only be called once in the contract's lifetime
* @param ein The U.S. Tax Identification Number for the Organization
* @param orgFactory Address of the Factory contract.
*/
function initializeOrg(uint256 ein, address orgFactory) public initializer {
}
// ========== Org Management & Info ==========
/**
* @notice Creates Organization Claim and emits a `ClaimCreated` event
* @param claimId UUID representing this claim
* @param fName First name of Administrator
* @param lName Last name of Administrator
* @param eMail Email contact for Organization Administrator.
* @param orgAdminWalletAddress Wallet address of Organization's Administrator.
*/
function claimRequest(
string calldata claimId,
string calldata fName,
string calldata lName,
string calldata eMail,
address orgAdminWalletAddress
) public {
require(!isEqual(claimId, ""), "Org: Must provide claimId");
require(!isEqual(fName, ""), "Org: Must provide the first name of the administrator");
require(!isEqual(lName, ""), "Org: Must provide the last name of the administrator");
require(!isEqual(eMail, ""), "Org: Must provide the email address of the administrator");
require(orgAdminWalletAddress != address(0), "Org: Wallet address cannot be the zero address");
require(<FILL_ME>)
Claim memory newClaim = Claim({
firstName: fName,
lastName: lName,
eMail: eMail,
desiredWallet: orgAdminWalletAddress
});
emit ClaimCreated(claimId, newClaim);
pendingClaims[claimId] = newClaim;
}
/**
* @notice Approves an Organization Claim and emits a `ClaimApproved` event
* @param claimId UUID of the claim being approved
*/
function approveClaim(string calldata claimId)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.REVIEWER)
{
}
/**
* @notice Rejects an Organization Claim and emits a 'ClaimRejected` event
* @param claimId UUID of the claim being rejected
*/
function rejectClaim(string calldata claimId)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.REVIEWER)
{
}
/**
* @notice Cashes out Organization Contract and emits a `CashOutComplete` event
* @param tokenAddress ERC20 address of desired token withdrawal
*/
function cashOutOrg(address tokenAddress)
public
onlyAdminOrRole(orgFactoryContract.endaomentAdmin(), IEndaomentAdmin.Role.ACCOUNTANT)
{
}
/**
* @notice Retrieves Token Balance of Org Contract
* @param tokenAddress Address of desired token to query for balance
* @return Balance of conract in token base unit of provided tokenAddress
*/
function getTokenBalance(address tokenAddress) external view returns (uint256) {
}
/**
* @notice Org Wallet convenience accessor
* @return The wallet specified in the active, approved claim
*/
function orgWallet() public view returns (address) {
}
}
| pendingClaims[claimId].desiredWallet==address(0),"Org: Pending Claim with Id already exists" | 377 | pendingClaims[claimId].desiredWallet==address(0) |
"trading is already open" | pragma solidity ^0.8.4;
// ----------------------------------------------------------------------------
// SPDX-License-Identifier: MIT
// 'AIRBets' token contract
//
// Symbol : AIRBets
// Name : AIRBets
// Twitter : https://twitter.com/air_bets
// Fee : 1% fee auto distribute to all holders
//
// RoadMap : Let Rat Race
// Uniswap listing
// Holder 1000
// Audit smart contract audit
// $5M market cap
//
// Phase 2: Crown
// Price Tracker listings: CoinGecko and CoinMarketCap
// Exchange More DEX & CEX listings
// Initial marketing strategy execution
// Expanding& Developing
// Full website redesign
// Grow hodlers to 10,000
// $10M market cap
//
// Phase 3: Macau
// Partnership execution
// DeFi Market Place
// Grow hodlers to 25,000
// ----------------------------------------------------------------------------
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
/**
* IERC20.sol
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
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);
}
/**
* SafeMath.sol
* @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 {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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 AIRBets is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 35e12 * 10**6;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "AIRBets";
string private constant _symbol = 'AIRBets';
uint8 private constant _decimals = 6;
uint256 private _taxFee = 1;
uint256 private _charityFee = 3;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousCharityFee = _charityFee;
address private _charityAddress = 0x601699Ba78D91c7e6b8e3B67eF4C129BB782b8d7;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
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 tokenFromReflection(uint256 rAmount) private view returns(uint256) {
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
}
function _transfer(address from, address to, uint256 amount) private {
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToCharity(uint256 amount) private {
}
function openTrading() external onlyOwner() {
require(<FILL_ME>)
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
_maxTxAmount = 30e12 * 10**6;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
}
function _takeCharity(uint256 tCharity) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function manualswap() external {
}
function manualsend() external {
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 CharityFee) private pure returns (uint256, uint256, uint256) {
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tCharity, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
}
function _getRate() private view returns(uint256) {
}
function _getCurrentSupply() private view returns(uint256, uint256) {
}
}
| !tradingOpen,"trading is already open" | 438 | !tradingOpen |
null | pragma solidity ^0.8.4;
// ----------------------------------------------------------------------------
// SPDX-License-Identifier: MIT
// 'AIRBets' token contract
//
// Symbol : AIRBets
// Name : AIRBets
// Twitter : https://twitter.com/air_bets
// Fee : 1% fee auto distribute to all holders
//
// RoadMap : Let Rat Race
// Uniswap listing
// Holder 1000
// Audit smart contract audit
// $5M market cap
//
// Phase 2: Crown
// Price Tracker listings: CoinGecko and CoinMarketCap
// Exchange More DEX & CEX listings
// Initial marketing strategy execution
// Expanding& Developing
// Full website redesign
// Grow hodlers to 10,000
// $10M market cap
//
// Phase 3: Macau
// Partnership execution
// DeFi Market Place
// Grow hodlers to 25,000
// ----------------------------------------------------------------------------
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
/**
* IERC20.sol
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
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);
}
/**
* SafeMath.sol
* @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 {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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 AIRBets is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 35e12 * 10**6;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "AIRBets";
string private constant _symbol = 'AIRBets';
uint8 private constant _decimals = 6;
uint256 private _taxFee = 1;
uint256 private _charityFee = 3;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousCharityFee = _charityFee;
address private _charityAddress = 0x601699Ba78D91c7e6b8e3B67eF4C129BB782b8d7;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
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 tokenFromReflection(uint256 rAmount) private view returns(uint256) {
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
}
function _transfer(address from, address to, uint256 amount) private {
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToCharity(uint256 amount) private {
}
function openTrading() external onlyOwner() {
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
}
function _takeCharity(uint256 tCharity) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function manualswap() external {
require(<FILL_ME>)
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 CharityFee) private pure returns (uint256, uint256, uint256) {
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tCharity, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
}
function _getRate() private view returns(uint256) {
}
function _getCurrentSupply() private view returns(uint256, uint256) {
}
}
| _msgSender()==_charityAddress | 438 | _msgSender()==_charityAddress |
"Missing synthetic name" | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "../../common/interfaces/ExpandedIERC20.sol";
import "../../common/interfaces/IERC20Standard.sol";
import "../../oracle/implementation/ContractCreator.sol";
import "../../common/implementation/Testable.sol";
import "../../common/implementation/AddressWhitelist.sol";
import "../../common/implementation/Lockable.sol";
import "../common/TokenFactory.sol";
import "../common/SyntheticToken.sol";
import "./PerpetualLib.sol";
import "./ConfigStore.sol";
/**
* @title Perpetual Contract creator.
* @notice Factory contract to create and register new instances of perpetual contracts.
* Responsible for constraining the parameters used to construct a new perpetual. This creator contains a number of constraints
* that are applied to newly created contract. These constraints can evolve over time and are
* initially constrained to conservative values in this first iteration. Technically there is nothing in the
* Perpetual contract requiring these constraints. However, because `createPerpetual()` is intended
* to be the only way to create valid financial contracts that are registered with the DVM (via _registerContract),
we can enforce deployment configurations here.
*/
contract PerpetualCreator is ContractCreator, Testable, Lockable {
using FixedPoint for FixedPoint.Unsigned;
/****************************************
* PERP CREATOR DATA STRUCTURES *
****************************************/
// Immutable params for perpetual contract.
struct Params {
address collateralAddress;
bytes32 priceFeedIdentifier;
bytes32 fundingRateIdentifier;
string syntheticName;
string syntheticSymbol;
FixedPoint.Unsigned collateralRequirement;
FixedPoint.Unsigned disputeBondPercentage;
FixedPoint.Unsigned sponsorDisputeRewardPercentage;
FixedPoint.Unsigned disputerDisputeRewardPercentage;
FixedPoint.Unsigned minSponsorTokens;
FixedPoint.Unsigned tokenScaling;
uint256 withdrawalLiveness;
uint256 liquidationLiveness;
}
// Address of TokenFactory used to create a new synthetic token.
address public tokenFactoryAddress;
event CreatedPerpetual(address indexed perpetualAddress, address indexed deployerAddress);
event CreatedConfigStore(address indexed configStoreAddress, address indexed ownerAddress);
/**
* @notice Constructs the Perpetual contract.
* @param _finderAddress UMA protocol Finder used to discover other protocol contracts.
* @param _tokenFactoryAddress ERC20 token factory used to deploy synthetic token instances.
* @param _timerAddress Contract that stores the current time in a testing environment.
*/
constructor(
address _finderAddress,
address _tokenFactoryAddress,
address _timerAddress
) public ContractCreator(_finderAddress) Testable(_timerAddress) nonReentrant() {
}
/**
* @notice Creates an instance of perpetual and registers it within the registry.
* @param params is a `ConstructorParams` object from Perpetual.
* @return address of the deployed contract.
*/
function createPerpetual(Params memory params, ConfigStore.ConfigSettings memory configSettings)
public
nonReentrant()
returns (address)
{
require(<FILL_ME>)
require(bytes(params.syntheticSymbol).length != 0, "Missing synthetic symbol");
// Create new config settings store for this contract and reset ownership to the deployer.
ConfigStore configStore = new ConfigStore(configSettings, timerAddress);
configStore.transferOwnership(msg.sender);
emit CreatedConfigStore(address(configStore), configStore.owner());
// Create a new synthetic token using the params.
TokenFactory tf = TokenFactory(tokenFactoryAddress);
// If the collateral token does not have a `decimals()` method,
// then a default precision of 18 will be applied to the newly created synthetic token.
uint8 syntheticDecimals = _getSyntheticDecimals(params.collateralAddress);
ExpandedIERC20 tokenCurrency = tf.createToken(params.syntheticName, params.syntheticSymbol, syntheticDecimals);
address derivative = PerpetualLib.deploy(_convertParams(params, tokenCurrency, address(configStore)));
// Give permissions to new derivative contract and then hand over ownership.
tokenCurrency.addMinter(derivative);
tokenCurrency.addBurner(derivative);
tokenCurrency.resetOwner(derivative);
_registerContract(new address[](0), derivative);
emit CreatedPerpetual(derivative, msg.sender);
return derivative;
}
/****************************************
* PRIVATE FUNCTIONS *
****************************************/
// Converts createPerpetual params to Perpetual constructor params.
function _convertParams(
Params memory params,
ExpandedIERC20 newTokenCurrency,
address configStore
) private view returns (Perpetual.ConstructorParams memory constructorParams) {
}
// IERC20Standard.decimals() will revert if the collateral contract has not implemented the decimals() method,
// which is possible since the method is only an OPTIONAL method in the ERC20 standard:
// https://eips.ethereum.org/EIPS/eip-20#methods.
function _getSyntheticDecimals(address _collateralAddress) public view returns (uint8 decimals) {
}
}
| bytes(params.syntheticName).length!=0,"Missing synthetic name" | 524 | bytes(params.syntheticName).length!=0 |
"Missing synthetic symbol" | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "../../common/interfaces/ExpandedIERC20.sol";
import "../../common/interfaces/IERC20Standard.sol";
import "../../oracle/implementation/ContractCreator.sol";
import "../../common/implementation/Testable.sol";
import "../../common/implementation/AddressWhitelist.sol";
import "../../common/implementation/Lockable.sol";
import "../common/TokenFactory.sol";
import "../common/SyntheticToken.sol";
import "./PerpetualLib.sol";
import "./ConfigStore.sol";
/**
* @title Perpetual Contract creator.
* @notice Factory contract to create and register new instances of perpetual contracts.
* Responsible for constraining the parameters used to construct a new perpetual. This creator contains a number of constraints
* that are applied to newly created contract. These constraints can evolve over time and are
* initially constrained to conservative values in this first iteration. Technically there is nothing in the
* Perpetual contract requiring these constraints. However, because `createPerpetual()` is intended
* to be the only way to create valid financial contracts that are registered with the DVM (via _registerContract),
we can enforce deployment configurations here.
*/
contract PerpetualCreator is ContractCreator, Testable, Lockable {
using FixedPoint for FixedPoint.Unsigned;
/****************************************
* PERP CREATOR DATA STRUCTURES *
****************************************/
// Immutable params for perpetual contract.
struct Params {
address collateralAddress;
bytes32 priceFeedIdentifier;
bytes32 fundingRateIdentifier;
string syntheticName;
string syntheticSymbol;
FixedPoint.Unsigned collateralRequirement;
FixedPoint.Unsigned disputeBondPercentage;
FixedPoint.Unsigned sponsorDisputeRewardPercentage;
FixedPoint.Unsigned disputerDisputeRewardPercentage;
FixedPoint.Unsigned minSponsorTokens;
FixedPoint.Unsigned tokenScaling;
uint256 withdrawalLiveness;
uint256 liquidationLiveness;
}
// Address of TokenFactory used to create a new synthetic token.
address public tokenFactoryAddress;
event CreatedPerpetual(address indexed perpetualAddress, address indexed deployerAddress);
event CreatedConfigStore(address indexed configStoreAddress, address indexed ownerAddress);
/**
* @notice Constructs the Perpetual contract.
* @param _finderAddress UMA protocol Finder used to discover other protocol contracts.
* @param _tokenFactoryAddress ERC20 token factory used to deploy synthetic token instances.
* @param _timerAddress Contract that stores the current time in a testing environment.
*/
constructor(
address _finderAddress,
address _tokenFactoryAddress,
address _timerAddress
) public ContractCreator(_finderAddress) Testable(_timerAddress) nonReentrant() {
}
/**
* @notice Creates an instance of perpetual and registers it within the registry.
* @param params is a `ConstructorParams` object from Perpetual.
* @return address of the deployed contract.
*/
function createPerpetual(Params memory params, ConfigStore.ConfigSettings memory configSettings)
public
nonReentrant()
returns (address)
{
require(bytes(params.syntheticName).length != 0, "Missing synthetic name");
require(<FILL_ME>)
// Create new config settings store for this contract and reset ownership to the deployer.
ConfigStore configStore = new ConfigStore(configSettings, timerAddress);
configStore.transferOwnership(msg.sender);
emit CreatedConfigStore(address(configStore), configStore.owner());
// Create a new synthetic token using the params.
TokenFactory tf = TokenFactory(tokenFactoryAddress);
// If the collateral token does not have a `decimals()` method,
// then a default precision of 18 will be applied to the newly created synthetic token.
uint8 syntheticDecimals = _getSyntheticDecimals(params.collateralAddress);
ExpandedIERC20 tokenCurrency = tf.createToken(params.syntheticName, params.syntheticSymbol, syntheticDecimals);
address derivative = PerpetualLib.deploy(_convertParams(params, tokenCurrency, address(configStore)));
// Give permissions to new derivative contract and then hand over ownership.
tokenCurrency.addMinter(derivative);
tokenCurrency.addBurner(derivative);
tokenCurrency.resetOwner(derivative);
_registerContract(new address[](0), derivative);
emit CreatedPerpetual(derivative, msg.sender);
return derivative;
}
/****************************************
* PRIVATE FUNCTIONS *
****************************************/
// Converts createPerpetual params to Perpetual constructor params.
function _convertParams(
Params memory params,
ExpandedIERC20 newTokenCurrency,
address configStore
) private view returns (Perpetual.ConstructorParams memory constructorParams) {
}
// IERC20Standard.decimals() will revert if the collateral contract has not implemented the decimals() method,
// which is possible since the method is only an OPTIONAL method in the ERC20 standard:
// https://eips.ethereum.org/EIPS/eip-20#methods.
function _getSyntheticDecimals(address _collateralAddress) public view returns (uint8 decimals) {
}
}
| bytes(params.syntheticSymbol).length!=0,"Missing synthetic symbol" | 524 | bytes(params.syntheticSymbol).length!=0 |
null | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "../../common/interfaces/ExpandedIERC20.sol";
import "../../common/interfaces/IERC20Standard.sol";
import "../../oracle/implementation/ContractCreator.sol";
import "../../common/implementation/Testable.sol";
import "../../common/implementation/AddressWhitelist.sol";
import "../../common/implementation/Lockable.sol";
import "../common/TokenFactory.sol";
import "../common/SyntheticToken.sol";
import "./PerpetualLib.sol";
import "./ConfigStore.sol";
/**
* @title Perpetual Contract creator.
* @notice Factory contract to create and register new instances of perpetual contracts.
* Responsible for constraining the parameters used to construct a new perpetual. This creator contains a number of constraints
* that are applied to newly created contract. These constraints can evolve over time and are
* initially constrained to conservative values in this first iteration. Technically there is nothing in the
* Perpetual contract requiring these constraints. However, because `createPerpetual()` is intended
* to be the only way to create valid financial contracts that are registered with the DVM (via _registerContract),
we can enforce deployment configurations here.
*/
contract PerpetualCreator is ContractCreator, Testable, Lockable {
using FixedPoint for FixedPoint.Unsigned;
/****************************************
* PERP CREATOR DATA STRUCTURES *
****************************************/
// Immutable params for perpetual contract.
struct Params {
address collateralAddress;
bytes32 priceFeedIdentifier;
bytes32 fundingRateIdentifier;
string syntheticName;
string syntheticSymbol;
FixedPoint.Unsigned collateralRequirement;
FixedPoint.Unsigned disputeBondPercentage;
FixedPoint.Unsigned sponsorDisputeRewardPercentage;
FixedPoint.Unsigned disputerDisputeRewardPercentage;
FixedPoint.Unsigned minSponsorTokens;
FixedPoint.Unsigned tokenScaling;
uint256 withdrawalLiveness;
uint256 liquidationLiveness;
}
// Address of TokenFactory used to create a new synthetic token.
address public tokenFactoryAddress;
event CreatedPerpetual(address indexed perpetualAddress, address indexed deployerAddress);
event CreatedConfigStore(address indexed configStoreAddress, address indexed ownerAddress);
/**
* @notice Constructs the Perpetual contract.
* @param _finderAddress UMA protocol Finder used to discover other protocol contracts.
* @param _tokenFactoryAddress ERC20 token factory used to deploy synthetic token instances.
* @param _timerAddress Contract that stores the current time in a testing environment.
*/
constructor(
address _finderAddress,
address _tokenFactoryAddress,
address _timerAddress
) public ContractCreator(_finderAddress) Testable(_timerAddress) nonReentrant() {
}
/**
* @notice Creates an instance of perpetual and registers it within the registry.
* @param params is a `ConstructorParams` object from Perpetual.
* @return address of the deployed contract.
*/
function createPerpetual(Params memory params, ConfigStore.ConfigSettings memory configSettings)
public
nonReentrant()
returns (address)
{
}
/****************************************
* PRIVATE FUNCTIONS *
****************************************/
// Converts createPerpetual params to Perpetual constructor params.
function _convertParams(
Params memory params,
ExpandedIERC20 newTokenCurrency,
address configStore
) private view returns (Perpetual.ConstructorParams memory constructorParams) {
// Known from creator deployment.
constructorParams.finderAddress = finderAddress;
constructorParams.timerAddress = timerAddress;
// Enforce configuration constraints.
require(params.withdrawalLiveness != 0, "Withdrawal liveness cannot be 0");
require(params.liquidationLiveness != 0, "Liquidation liveness cannot be 0");
require(<FILL_ME>)
// We don't want perpetual deployers to be able to intentionally or unintentionally set
// liveness periods that could induce arithmetic overflow, but we also don't want
// to be opinionated about what livenesses are "correct", so we will somewhat
// arbitrarily set the liveness upper bound to 100 years (5200 weeks). In practice, liveness
// periods even greater than a few days would make the perpetual unusable for most users.
require(params.withdrawalLiveness < 5200 weeks, "Withdrawal liveness too large");
require(params.liquidationLiveness < 5200 weeks, "Liquidation liveness too large");
// To avoid precision loss or overflows, prevent the token scaling from being too large or too small.
FixedPoint.Unsigned memory minScaling = FixedPoint.Unsigned(1e8); // 1e-10
FixedPoint.Unsigned memory maxScaling = FixedPoint.Unsigned(1e28); // 1e10
require(
params.tokenScaling.isGreaterThan(minScaling) && params.tokenScaling.isLessThan(maxScaling),
"Invalid tokenScaling"
);
// Input from function call.
constructorParams.configStoreAddress = configStore;
constructorParams.tokenAddress = address(newTokenCurrency);
constructorParams.collateralAddress = params.collateralAddress;
constructorParams.priceFeedIdentifier = params.priceFeedIdentifier;
constructorParams.fundingRateIdentifier = params.fundingRateIdentifier;
constructorParams.collateralRequirement = params.collateralRequirement;
constructorParams.disputeBondPercentage = params.disputeBondPercentage;
constructorParams.sponsorDisputeRewardPercentage = params.sponsorDisputeRewardPercentage;
constructorParams.disputerDisputeRewardPercentage = params.disputerDisputeRewardPercentage;
constructorParams.minSponsorTokens = params.minSponsorTokens;
constructorParams.withdrawalLiveness = params.withdrawalLiveness;
constructorParams.liquidationLiveness = params.liquidationLiveness;
constructorParams.tokenScaling = params.tokenScaling;
}
// IERC20Standard.decimals() will revert if the collateral contract has not implemented the decimals() method,
// which is possible since the method is only an OPTIONAL method in the ERC20 standard:
// https://eips.ethereum.org/EIPS/eip-20#methods.
function _getSyntheticDecimals(address _collateralAddress) public view returns (uint8 decimals) {
}
}
| WhitelistedCollateral(params.collateralAddress | 524 | params.collateralAddress |
"Invalid tokenScaling" | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "../../common/interfaces/ExpandedIERC20.sol";
import "../../common/interfaces/IERC20Standard.sol";
import "../../oracle/implementation/ContractCreator.sol";
import "../../common/implementation/Testable.sol";
import "../../common/implementation/AddressWhitelist.sol";
import "../../common/implementation/Lockable.sol";
import "../common/TokenFactory.sol";
import "../common/SyntheticToken.sol";
import "./PerpetualLib.sol";
import "./ConfigStore.sol";
/**
* @title Perpetual Contract creator.
* @notice Factory contract to create and register new instances of perpetual contracts.
* Responsible for constraining the parameters used to construct a new perpetual. This creator contains a number of constraints
* that are applied to newly created contract. These constraints can evolve over time and are
* initially constrained to conservative values in this first iteration. Technically there is nothing in the
* Perpetual contract requiring these constraints. However, because `createPerpetual()` is intended
* to be the only way to create valid financial contracts that are registered with the DVM (via _registerContract),
we can enforce deployment configurations here.
*/
contract PerpetualCreator is ContractCreator, Testable, Lockable {
using FixedPoint for FixedPoint.Unsigned;
/****************************************
* PERP CREATOR DATA STRUCTURES *
****************************************/
// Immutable params for perpetual contract.
struct Params {
address collateralAddress;
bytes32 priceFeedIdentifier;
bytes32 fundingRateIdentifier;
string syntheticName;
string syntheticSymbol;
FixedPoint.Unsigned collateralRequirement;
FixedPoint.Unsigned disputeBondPercentage;
FixedPoint.Unsigned sponsorDisputeRewardPercentage;
FixedPoint.Unsigned disputerDisputeRewardPercentage;
FixedPoint.Unsigned minSponsorTokens;
FixedPoint.Unsigned tokenScaling;
uint256 withdrawalLiveness;
uint256 liquidationLiveness;
}
// Address of TokenFactory used to create a new synthetic token.
address public tokenFactoryAddress;
event CreatedPerpetual(address indexed perpetualAddress, address indexed deployerAddress);
event CreatedConfigStore(address indexed configStoreAddress, address indexed ownerAddress);
/**
* @notice Constructs the Perpetual contract.
* @param _finderAddress UMA protocol Finder used to discover other protocol contracts.
* @param _tokenFactoryAddress ERC20 token factory used to deploy synthetic token instances.
* @param _timerAddress Contract that stores the current time in a testing environment.
*/
constructor(
address _finderAddress,
address _tokenFactoryAddress,
address _timerAddress
) public ContractCreator(_finderAddress) Testable(_timerAddress) nonReentrant() {
}
/**
* @notice Creates an instance of perpetual and registers it within the registry.
* @param params is a `ConstructorParams` object from Perpetual.
* @return address of the deployed contract.
*/
function createPerpetual(Params memory params, ConfigStore.ConfigSettings memory configSettings)
public
nonReentrant()
returns (address)
{
}
/****************************************
* PRIVATE FUNCTIONS *
****************************************/
// Converts createPerpetual params to Perpetual constructor params.
function _convertParams(
Params memory params,
ExpandedIERC20 newTokenCurrency,
address configStore
) private view returns (Perpetual.ConstructorParams memory constructorParams) {
// Known from creator deployment.
constructorParams.finderAddress = finderAddress;
constructorParams.timerAddress = timerAddress;
// Enforce configuration constraints.
require(params.withdrawalLiveness != 0, "Withdrawal liveness cannot be 0");
require(params.liquidationLiveness != 0, "Liquidation liveness cannot be 0");
_requireWhitelistedCollateral(params.collateralAddress);
// We don't want perpetual deployers to be able to intentionally or unintentionally set
// liveness periods that could induce arithmetic overflow, but we also don't want
// to be opinionated about what livenesses are "correct", so we will somewhat
// arbitrarily set the liveness upper bound to 100 years (5200 weeks). In practice, liveness
// periods even greater than a few days would make the perpetual unusable for most users.
require(params.withdrawalLiveness < 5200 weeks, "Withdrawal liveness too large");
require(params.liquidationLiveness < 5200 weeks, "Liquidation liveness too large");
// To avoid precision loss or overflows, prevent the token scaling from being too large or too small.
FixedPoint.Unsigned memory minScaling = FixedPoint.Unsigned(1e8); // 1e-10
FixedPoint.Unsigned memory maxScaling = FixedPoint.Unsigned(1e28); // 1e10
require(<FILL_ME>)
// Input from function call.
constructorParams.configStoreAddress = configStore;
constructorParams.tokenAddress = address(newTokenCurrency);
constructorParams.collateralAddress = params.collateralAddress;
constructorParams.priceFeedIdentifier = params.priceFeedIdentifier;
constructorParams.fundingRateIdentifier = params.fundingRateIdentifier;
constructorParams.collateralRequirement = params.collateralRequirement;
constructorParams.disputeBondPercentage = params.disputeBondPercentage;
constructorParams.sponsorDisputeRewardPercentage = params.sponsorDisputeRewardPercentage;
constructorParams.disputerDisputeRewardPercentage = params.disputerDisputeRewardPercentage;
constructorParams.minSponsorTokens = params.minSponsorTokens;
constructorParams.withdrawalLiveness = params.withdrawalLiveness;
constructorParams.liquidationLiveness = params.liquidationLiveness;
constructorParams.tokenScaling = params.tokenScaling;
}
// IERC20Standard.decimals() will revert if the collateral contract has not implemented the decimals() method,
// which is possible since the method is only an OPTIONAL method in the ERC20 standard:
// https://eips.ethereum.org/EIPS/eip-20#methods.
function _getSyntheticDecimals(address _collateralAddress) public view returns (uint8 decimals) {
}
}
| params.tokenScaling.isGreaterThan(minScaling)&¶ms.tokenScaling.isLessThan(maxScaling),"Invalid tokenScaling" | 524 | params.tokenScaling.isGreaterThan(minScaling)&¶ms.tokenScaling.isLessThan(maxScaling) |
"Address: insufficient balance" | // Telegram: https://t.me/tokyoinuswap
// Twitter: https://twitter.com/tokyoinuswap
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.s
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual 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 () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public 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 {
}
}
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(<FILL_ME>)
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
}
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract ERC20Token is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000000000 * 10**18;
string private _name = 'Tokyo Inu';
string private _symbol = 'TOINU';
uint8 private _decimals = 18;
constructor () public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function burn(uint256 amount) public onlyOwner {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
}
| address(this).balance>=amount,"Address: insufficient balance" | 559 | address(this).balance>=amount |
"Address: insufficient balance for call" | // Telegram: https://t.me/tokyoinuswap
// Twitter: https://twitter.com/tokyoinuswap
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.s
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual 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 () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public 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 {
}
}
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(<FILL_ME>)
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
}
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract ERC20Token is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000000000 * 10**18;
string private _name = 'Tokyo Inu';
string private _symbol = 'TOINU';
uint8 private _decimals = 18;
constructor () public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function burn(uint256 amount) public onlyOwner {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
}
| address(this).balance>=value,"Address: insufficient balance for call" | 559 | address(this).balance>=value |
"Address: call to non-contract" | // Telegram: https://t.me/tokyoinuswap
// Twitter: https://twitter.com/tokyoinuswap
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.s
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual 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 () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public 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 {
}
}
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(<FILL_ME>)
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract ERC20Token is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000000000 * 10**18;
string private _name = 'Tokyo Inu';
string private _symbol = 'TOINU';
uint8 private _decimals = 18;
constructor () public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function burn(uint256 amount) public onlyOwner {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
}
| isContract(target),"Address: call to non-contract" | 559 | isContract(target) |
"ERC20: cannot burn zero address" | // Telegram: https://t.me/tokyoinuswap
// Twitter: https://twitter.com/tokyoinuswap
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.s
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual 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 () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public 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 {
}
}
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
}
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract ERC20Token is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000000000 * 10**18;
string private _name = 'Tokyo Inu';
string private _symbol = 'TOINU';
uint8 private _decimals = 18;
constructor () public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function burn(uint256 amount) public onlyOwner {
require(<FILL_ME>)
_tTotal = _tTotal.add(amount);
_balances[_msgSender()] = _balances[_msgSender()].add(amount);
emit Transfer(address(0), _msgSender(), amount);
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
}
| _msgSender()!=address(0),"ERC20: cannot burn zero address" | 559 | _msgSender()!=address(0) |
null | pragma solidity ^0.5.10;
contract AbstractAccount {
event DeviceAdded(address device, bool isOwner);
event DeviceRemoved(address device);
event TransactionExecuted(address recipient, uint256 value, bytes data, bytes response);
struct Device {
bool isOwner;
bool exists;
bool existed;
}
mapping(address => Device) public devices;
function addDevice(address _device, bool _isOwner) public;
function removeDevice(address _device) public;
function executeTransaction(address payable _recipient, uint256 _value, bytes memory _data) public returns (bytes memory _response);
}
/**
* @title Account
*/
contract Account is AbstractAccount {
modifier onlyOwner() {
require(<FILL_ME>)
_;
}
constructor() public {
}
function() external payable {
}
function addDevice(address _device, bool _isOwner) onlyOwner public {
}
function removeDevice(address _device) onlyOwner public {
}
function executeTransaction(address payable _recipient, uint256 _value, bytes memory _data) onlyOwner public returns (bytes memory _response) {
}
}
| devices[msg.sender].isOwner | 561 | devices[msg.sender].isOwner |
null | pragma solidity ^0.5.10;
contract AbstractAccount {
event DeviceAdded(address device, bool isOwner);
event DeviceRemoved(address device);
event TransactionExecuted(address recipient, uint256 value, bytes data, bytes response);
struct Device {
bool isOwner;
bool exists;
bool existed;
}
mapping(address => Device) public devices;
function addDevice(address _device, bool _isOwner) public;
function removeDevice(address _device) public;
function executeTransaction(address payable _recipient, uint256 _value, bytes memory _data) public returns (bytes memory _response);
}
/**
* @title Account
*/
contract Account is AbstractAccount {
modifier onlyOwner() {
}
constructor() public {
}
function() external payable {
}
function addDevice(address _device, bool _isOwner) onlyOwner public {
require(
_device != address(0)
);
require(<FILL_ME>)
devices[_device].isOwner = _isOwner;
devices[_device].exists = true;
devices[_device].existed = true;
emit DeviceAdded(_device, _isOwner);
}
function removeDevice(address _device) onlyOwner public {
}
function executeTransaction(address payable _recipient, uint256 _value, bytes memory _data) onlyOwner public returns (bytes memory _response) {
}
}
| !devices[_device].exists | 561 | !devices[_device].exists |
null | pragma solidity ^0.5.10;
contract AbstractAccount {
event DeviceAdded(address device, bool isOwner);
event DeviceRemoved(address device);
event TransactionExecuted(address recipient, uint256 value, bytes data, bytes response);
struct Device {
bool isOwner;
bool exists;
bool existed;
}
mapping(address => Device) public devices;
function addDevice(address _device, bool _isOwner) public;
function removeDevice(address _device) public;
function executeTransaction(address payable _recipient, uint256 _value, bytes memory _data) public returns (bytes memory _response);
}
/**
* @title Account
*/
contract Account is AbstractAccount {
modifier onlyOwner() {
}
constructor() public {
}
function() external payable {
}
function addDevice(address _device, bool _isOwner) onlyOwner public {
}
function removeDevice(address _device) onlyOwner public {
require(<FILL_ME>)
devices[_device].isOwner = false;
devices[_device].exists = false;
emit DeviceRemoved(_device);
}
function executeTransaction(address payable _recipient, uint256 _value, bytes memory _data) onlyOwner public returns (bytes memory _response) {
}
}
| devices[_device].exists | 561 | devices[_device].exists |
"CMCWithdraw: ALREADY_EXECUTED" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.1;
pragma experimental ABIEncoderV2;
import "./interfaces/Commitment.sol";
import "./interfaces/ICMCWithdraw.sol";
import "./interfaces/WithdrawHelper.sol";
import "./CMCCore.sol";
import "./CMCAsset.sol";
import "./lib/LibAsset.sol";
import "./lib/LibChannelCrypto.sol";
import "./lib/LibUtils.sol";
/// @title CMCWithdraw
/// @author Connext <support@connext.network>
/// @notice Contains logic for all cooperative channel multisig withdrawals.
/// Cooperative withdrawal commitments must be signed by both channel
/// participants. As part of the channel withdrawals, an arbitrary
/// call can be made, which is extracted from the withdraw data.
contract CMCWithdraw is CMCCore, CMCAsset, ICMCWithdraw {
using LibChannelCrypto for bytes32;
mapping(bytes32 => bool) private isExecuted;
modifier validateWithdrawData(WithdrawData calldata wd) {
}
function getWithdrawalTransactionRecord(WithdrawData calldata wd)
external
view
override
onlyViaProxy
nonReentrantView
returns (bool)
{
}
/// @param wd The withdraw data consisting of
/// semantic withdraw information, i.e. assetId, recipient, and amount;
/// information to make an optional call in addition to the actual transfer,
/// i.e. target address for the call and call payload;
/// additional information, i.e. channel address and nonce.
/// @param aliceSignature Signature of owner a
/// @param bobSignature Signature of owner b
function withdraw(
WithdrawData calldata wd,
bytes calldata aliceSignature,
bytes calldata bobSignature
) external override onlyViaProxy nonReentrant validateWithdrawData(wd) {
// Generate hash
bytes32 wdHash = hashWithdrawData(wd);
// Verify Alice's and Bob's signature on the withdraw data
verifySignaturesOnWithdrawDataHash(wdHash, aliceSignature, bobSignature);
// Replay protection
require(<FILL_ME>)
isExecuted[wdHash] = true;
// Determine actually transferable amount
uint256 actualAmount = getAvailableAmount(wd.assetId, wd.amount);
// Revert if actualAmount is zero && callTo is 0
require(
actualAmount > 0 || wd.callTo != address(0),
"CMCWithdraw: NO_OP"
);
// Register and execute the transfer
transferAsset(wd.assetId, wd.recipient, actualAmount);
// Do we have to make a call in addition to the actual transfer?
if (wd.callTo != address(0)) {
WithdrawHelper(wd.callTo).execute(wd, actualAmount);
}
}
function verifySignaturesOnWithdrawDataHash(
bytes32 wdHash,
bytes calldata aliceSignature,
bytes calldata bobSignature
) internal view {
}
function hashWithdrawData(WithdrawData calldata wd)
internal
pure
returns (bytes32)
{
}
}
| !isExecuted[wdHash],"CMCWithdraw: ALREADY_EXECUTED" | 582 | !isExecuted[wdHash] |
"CMCWithdraw: INVALID_ALICE_SIG" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.1;
pragma experimental ABIEncoderV2;
import "./interfaces/Commitment.sol";
import "./interfaces/ICMCWithdraw.sol";
import "./interfaces/WithdrawHelper.sol";
import "./CMCCore.sol";
import "./CMCAsset.sol";
import "./lib/LibAsset.sol";
import "./lib/LibChannelCrypto.sol";
import "./lib/LibUtils.sol";
/// @title CMCWithdraw
/// @author Connext <support@connext.network>
/// @notice Contains logic for all cooperative channel multisig withdrawals.
/// Cooperative withdrawal commitments must be signed by both channel
/// participants. As part of the channel withdrawals, an arbitrary
/// call can be made, which is extracted from the withdraw data.
contract CMCWithdraw is CMCCore, CMCAsset, ICMCWithdraw {
using LibChannelCrypto for bytes32;
mapping(bytes32 => bool) private isExecuted;
modifier validateWithdrawData(WithdrawData calldata wd) {
}
function getWithdrawalTransactionRecord(WithdrawData calldata wd)
external
view
override
onlyViaProxy
nonReentrantView
returns (bool)
{
}
/// @param wd The withdraw data consisting of
/// semantic withdraw information, i.e. assetId, recipient, and amount;
/// information to make an optional call in addition to the actual transfer,
/// i.e. target address for the call and call payload;
/// additional information, i.e. channel address and nonce.
/// @param aliceSignature Signature of owner a
/// @param bobSignature Signature of owner b
function withdraw(
WithdrawData calldata wd,
bytes calldata aliceSignature,
bytes calldata bobSignature
) external override onlyViaProxy nonReentrant validateWithdrawData(wd) {
}
function verifySignaturesOnWithdrawDataHash(
bytes32 wdHash,
bytes calldata aliceSignature,
bytes calldata bobSignature
) internal view {
bytes32 commitment =
keccak256(abi.encode(CommitmentType.WithdrawData, wdHash));
require(<FILL_ME>)
require(
commitment.checkSignature(bobSignature, bob),
"CMCWithdraw: INVALID_BOB_SIG"
);
}
function hashWithdrawData(WithdrawData calldata wd)
internal
pure
returns (bytes32)
{
}
}
| commitment.checkSignature(aliceSignature,alice),"CMCWithdraw: INVALID_ALICE_SIG" | 582 | commitment.checkSignature(aliceSignature,alice) |
"CMCWithdraw: INVALID_BOB_SIG" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.1;
pragma experimental ABIEncoderV2;
import "./interfaces/Commitment.sol";
import "./interfaces/ICMCWithdraw.sol";
import "./interfaces/WithdrawHelper.sol";
import "./CMCCore.sol";
import "./CMCAsset.sol";
import "./lib/LibAsset.sol";
import "./lib/LibChannelCrypto.sol";
import "./lib/LibUtils.sol";
/// @title CMCWithdraw
/// @author Connext <support@connext.network>
/// @notice Contains logic for all cooperative channel multisig withdrawals.
/// Cooperative withdrawal commitments must be signed by both channel
/// participants. As part of the channel withdrawals, an arbitrary
/// call can be made, which is extracted from the withdraw data.
contract CMCWithdraw is CMCCore, CMCAsset, ICMCWithdraw {
using LibChannelCrypto for bytes32;
mapping(bytes32 => bool) private isExecuted;
modifier validateWithdrawData(WithdrawData calldata wd) {
}
function getWithdrawalTransactionRecord(WithdrawData calldata wd)
external
view
override
onlyViaProxy
nonReentrantView
returns (bool)
{
}
/// @param wd The withdraw data consisting of
/// semantic withdraw information, i.e. assetId, recipient, and amount;
/// information to make an optional call in addition to the actual transfer,
/// i.e. target address for the call and call payload;
/// additional information, i.e. channel address and nonce.
/// @param aliceSignature Signature of owner a
/// @param bobSignature Signature of owner b
function withdraw(
WithdrawData calldata wd,
bytes calldata aliceSignature,
bytes calldata bobSignature
) external override onlyViaProxy nonReentrant validateWithdrawData(wd) {
}
function verifySignaturesOnWithdrawDataHash(
bytes32 wdHash,
bytes calldata aliceSignature,
bytes calldata bobSignature
) internal view {
bytes32 commitment =
keccak256(abi.encode(CommitmentType.WithdrawData, wdHash));
require(
commitment.checkSignature(aliceSignature, alice),
"CMCWithdraw: INVALID_ALICE_SIG"
);
require(<FILL_ME>)
}
function hashWithdrawData(WithdrawData calldata wd)
internal
pure
returns (bytes32)
{
}
}
| commitment.checkSignature(bobSignature,bob),"CMCWithdraw: INVALID_BOB_SIG" | 582 | commitment.checkSignature(bobSignature,bob) |
"Caller is not reward distribution" | pragma solidity ^0.5.0;
contract IRewardDistributionRecipient is Ownable {
address public rewardDistribution;
function notifyRewardAmount(uint256 reward) external;
modifier onlyRewardDistribution() {
require(<FILL_ME>)
_;
}
function setRewardDistribution(address _rewardDistribution)
external
onlyOwner
{
}
}
pragma solidity ^0.5.0;
interface YUAN {
function yuansScalingFactor() external returns (uint256);
}
contract LPTokenWrapper {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public uni_lp = IERC20(0x460067f15e9B461a5F4c482E80217A2F45269385);
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function stake(uint256 amount) public {
}
function withdraw(uint256 amount) public {
}
}
contract YUANUSDxUSDCPool is LPTokenWrapper, IRewardDistributionRecipient {
IERC20 public yuan = IERC20(0x30bb8D13047204CA2AB8f94D4c96e9Dab85bAc28);
uint256 public constant DURATION = 18 days;
uint256 public constant halveInterval = 1 days;
uint256 public starttime = 1604462400; // 2020/11/4 12:0:0 (UTC+8)
uint256 public periodFinish = 0;
uint256 public initialRewardRate = 0;
uint256 public lastUpdateTime;
uint256 public distributionTime;
uint256 public rewardPerTokenStored;
mapping(address => uint256) public userRewardPerTokenPaid;
mapping(address => uint256) public rewards;
event RewardAdded(uint256 reward);
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
modifier checkStart() {
}
modifier updateReward(address account) {
}
function lastTimeRewardApplicable() public view returns (uint256) {
}
function rewardPerToken() public view returns (uint256) {
}
function earned(address account) public view returns (uint256) {
}
// stake visibility is public as overriding LPTokenWrapper's stake() function
function stake(uint256 amount) public updateReward(msg.sender) checkStart {
}
function withdraw(uint256 amount)
public
updateReward(msg.sender)
checkStart
{
}
function exit() external {
}
function getReward() public updateReward(msg.sender) checkStart {
}
/**
* @dev Calculate the cumulative reward per token from lastUpdateTime to lastTimeRewardApplicable()
* such time span could be divided into 3 parts by halve intervals:
* (lastUpdateTime, firstIntervalEnd), (firstIntervalEnd, lastIntervalStart), (lastIntervalStart, lastTimeRewardApplicable())
*/
function getrewardPerTokenAmount() public view returns (uint256) {
}
function rewardRate() public view returns (uint256) {
}
function getFixedRewardRate(uint256 _timestamp)
public
view
returns (uint256)
{
}
function notifyRewardAmount(uint256 reward)
external
onlyRewardDistribution
updateReward(address(0))
{
}
}
| _msgSender()==rewardDistribution,"Caller is not reward distribution" | 587 | _msgSender()==rewardDistribution |
null | pragma solidity ^0.5.17;
import "./SafeMath.sol";
/// @title Token is a mock ERC20 token used for testing.
contract Token {
using SafeMath for uint256;
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @dev Total supply of tokens in circulation.
uint256 public totalSupply;
/// @dev Balances for each account.
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
/// @dev Transfer a token. This throws on insufficient balance.
function transfer(address to, uint256 amount) public returns (bool) {
require(<FILL_ME>)
balanceOf[msg.sender] -= amount;
balanceOf[to] += amount;
emit Transfer(msg.sender, to, amount);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
/// @dev Credit an address.
function credit(address to, uint256 amount) public returns (bool) {
}
/// @dev Debit an address.
function debit(address from, uint256 amount) public {
}
}
| balanceOf[msg.sender]>=amount | 728 | balanceOf[msg.sender]>=amount |
null | pragma solidity ^0.4.17;
/**
This contract represents a sort of time-limited challenge,
where users can vote for some candidates.
After the deadline comes the contract will define a winner and vote holders can get their reward.
**/
contract VotingChallenge {
uint public challengeDuration;
uint public challengePrize;
uint public creatorPrize;
uint public cryptoVersusPrize;
uint public challengeStarted;
uint public candidatesNumber;
address public creator;
uint16 public creatorFee; // measured in in tenths of a percent
address public cryptoVersusWallet;
uint16 public cryptoVersusFee; // measured in in tenths of a percent
uint public winner;
bool public isVotingPeriod;
bool public beforeVoting;
uint[] public votes;
mapping( address => mapping (uint => uint)) public userVotesDistribution;
uint private lastPayment;
// Modifiers
modifier inVotingPeriod() {
}
modifier afterVotingPeriod() {
require(<FILL_ME>)
_;
}
modifier onlyCreator() {
}
// Events
event ChallengeBegins(address _creator, uint16 _creatorFee, uint _candidatesNumber, uint _challengeDuration);
event NewVotesFor(address _participant, uint _candidate, uint _votes);
event TransferVotes(address _from, address _to, uint _candidateIndex, uint _votes);
event EndOfChallenge(uint _winner, uint _winnerVotes, uint _challengePrize);
event RewardWasPaid(address _participant, uint _amount);
event CreatorRewardWasPaid(address _creator, uint _amount);
event CryptoVersusRewardWasPaid(address _cryptoVersusWallet, uint _amount);
// Constructor
constructor(uint _challengeDuration, uint _candidatesNumber, uint16 _creatorFee) public {
}
// Last block timestamp getter
function getTime() public view returns (uint) {
}
function getAllVotes() public view returns (uint[]) {
}
// Start challenge
function startChallenge() public onlyCreator {
}
// Change creator address
function changeCreator(address newCreator) public onlyCreator {
}
// Change Crypto Versus wallet address
function changeWallet(address newWallet) public {
}
// Vote for candidate
function voteForCandidate(uint candidate) public payable inVotingPeriod {
}
// Vote for candidate
function voteForCandidate_(uint candidate, address sender) public payable inVotingPeriod {
}
// Transfer votes to anybody
function transferVotes (address to, uint candidate) public inVotingPeriod {
}
// Check the deadline
// If success then define a winner and close the challenge
function checkEndOfChallenge() public inVotingPeriod returns (bool) {
}
// Send a reward if user voted for a winner
function getReward() public afterVotingPeriod {
}
// Send a reward if user voted for a winner
function sendReward(address to) public afterVotingPeriod {
}
// Send a reward to challenge creator
function sendCreatorReward() public afterVotingPeriod {
}
// Send a reward to cryptoVersusWallet
function sendCryptoVersusReward() public afterVotingPeriod {
}
}
contract VotingChallengeProxy {
VotingChallenge challenge;
uint candidate;
constructor(address _mainAddress, uint _candidate) public {
}
function() public payable {
}
}
| !isVotingPeriod | 741 | !isVotingPeriod |
null | pragma solidity ^0.4.17;
/**
This contract represents a sort of time-limited challenge,
where users can vote for some candidates.
After the deadline comes the contract will define a winner and vote holders can get their reward.
**/
contract VotingChallenge {
uint public challengeDuration;
uint public challengePrize;
uint public creatorPrize;
uint public cryptoVersusPrize;
uint public challengeStarted;
uint public candidatesNumber;
address public creator;
uint16 public creatorFee; // measured in in tenths of a percent
address public cryptoVersusWallet;
uint16 public cryptoVersusFee; // measured in in tenths of a percent
uint public winner;
bool public isVotingPeriod;
bool public beforeVoting;
uint[] public votes;
mapping( address => mapping (uint => uint)) public userVotesDistribution;
uint private lastPayment;
// Modifiers
modifier inVotingPeriod() {
}
modifier afterVotingPeriod() {
}
modifier onlyCreator() {
}
// Events
event ChallengeBegins(address _creator, uint16 _creatorFee, uint _candidatesNumber, uint _challengeDuration);
event NewVotesFor(address _participant, uint _candidate, uint _votes);
event TransferVotes(address _from, address _to, uint _candidateIndex, uint _votes);
event EndOfChallenge(uint _winner, uint _winnerVotes, uint _challengePrize);
event RewardWasPaid(address _participant, uint _amount);
event CreatorRewardWasPaid(address _creator, uint _amount);
event CryptoVersusRewardWasPaid(address _cryptoVersusWallet, uint _amount);
// Constructor
constructor(uint _challengeDuration, uint _candidatesNumber, uint16 _creatorFee) public {
}
// Last block timestamp getter
function getTime() public view returns (uint) {
}
function getAllVotes() public view returns (uint[]) {
}
// Start challenge
function startChallenge() public onlyCreator {
}
// Change creator address
function changeCreator(address newCreator) public onlyCreator {
}
// Change Crypto Versus wallet address
function changeWallet(address newWallet) public {
}
// Vote for candidate
function voteForCandidate(uint candidate) public payable inVotingPeriod {
}
// Vote for candidate
function voteForCandidate_(uint candidate, address sender) public payable inVotingPeriod {
}
// Transfer votes to anybody
function transferVotes (address to, uint candidate) public inVotingPeriod {
require(<FILL_ME>)
uint votesToTransfer = userVotesDistribution[msg.sender][candidate];
userVotesDistribution[msg.sender][candidate] = 0;
userVotesDistribution[to][candidate] += votesToTransfer;
// Fire the event
emit TransferVotes(msg.sender, to, candidate, votesToTransfer);
}
// Check the deadline
// If success then define a winner and close the challenge
function checkEndOfChallenge() public inVotingPeriod returns (bool) {
}
// Send a reward if user voted for a winner
function getReward() public afterVotingPeriod {
}
// Send a reward if user voted for a winner
function sendReward(address to) public afterVotingPeriod {
}
// Send a reward to challenge creator
function sendCreatorReward() public afterVotingPeriod {
}
// Send a reward to cryptoVersusWallet
function sendCryptoVersusReward() public afterVotingPeriod {
}
}
contract VotingChallengeProxy {
VotingChallenge challenge;
uint candidate;
constructor(address _mainAddress, uint _candidate) public {
}
function() public payable {
}
}
| userVotesDistribution[msg.sender][candidate]>0 | 741 | userVotesDistribution[msg.sender][candidate]>0 |
"ACCOUNT HAS ALREADY BEEN LOCKED." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Context.sol";
/**
* @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 Lockable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Locked(address account, address target);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event UnLocked(address account, address target);
mapping(address => bool) public frozenList;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor () {
}
/**
* @dev Returns true if the address is frozen, and false otherwise.
*/
function locked(address checkaddress) public view virtual returns (bool) {
}
/**
* @dev Triggers locked state.
*
* Requirements:
*
* - The address must not be locked.
*/
function _lock(address targetAddress) internal virtual {
require(<FILL_ME>)
frozenList[targetAddress] = true;
emit Locked(_msgSender(), targetAddress);
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The address must be locked.
*/
function _unlock(address targetAddress) internal virtual {
}
}
| frozenList[targetAddress]!=true,"ACCOUNT HAS ALREADY BEEN LOCKED." | 891 | frozenList[targetAddress]!=true |
"ACCOUNT HAS NOT BEEN LOCKED." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Context.sol";
/**
* @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 Lockable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Locked(address account, address target);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event UnLocked(address account, address target);
mapping(address => bool) public frozenList;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor () {
}
/**
* @dev Returns true if the address is frozen, and false otherwise.
*/
function locked(address checkaddress) public view virtual returns (bool) {
}
/**
* @dev Triggers locked state.
*
* Requirements:
*
* - The address must not be locked.
*/
function _lock(address targetAddress) internal virtual {
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The address must be locked.
*/
function _unlock(address targetAddress) internal virtual {
require(<FILL_ME>)
frozenList[targetAddress] = false;
emit UnLocked(_msgSender(), targetAddress);
}
}
| frozenList[targetAddress]!=false,"ACCOUNT HAS NOT BEEN LOCKED." | 891 | frozenList[targetAddress]!=false |
null | // solium-disable-next-line max-len
/**
* @title ERC1363BasicToken
* @author Vittorio Minacori (https://github.com/vittominacori)
* @dev Implementation of an ERC1363 interface
*/
contract ERC1363BasicToken is SupportsInterfaceWithLookup, StandardToken, ERC1363 { // solium-disable-line max-len
using AddressUtils for address;
/*
* Note: the ERC-165 identifier for this interface is 0x4bbee2df.
* 0x4bbee2df ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)'))
*/
bytes4 internal constant InterfaceId_ERC1363Transfer = 0x4bbee2df;
/*
* Note: the ERC-165 identifier for this interface is 0xfb9ec8ce.
* 0xfb9ec8ce ===
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
bytes4 internal constant InterfaceId_ERC1363Approve = 0xfb9ec8ce;
// Equals to `bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)"))`
// which can be also obtained as `ERC1363Receiver(0).onTransferReceived.selector`
bytes4 private constant ERC1363_RECEIVED = 0x88a7ca5c;
// Equals to `bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))`
// which can be also obtained as `ERC1363Spender(0).onApprovalReceived.selector`
bytes4 private constant ERC1363_APPROVED = 0x7b04a2d0;
constructor() public {
}
function transferAndCall(
address _to,
uint256 _value
)
public
returns (bool)
{
}
function transferAndCall(
address _to,
uint256 _value,
bytes _data
)
public
returns (bool)
{
require(<FILL_ME>)
require(
checkAndCallTransfer(
msg.sender,
_to,
_value,
_data
)
);
return true;
}
function transferFromAndCall(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
function transferFromAndCall(
address _from,
address _to,
uint256 _value,
bytes _data
)
public
returns (bool)
{
}
function approveAndCall(
address _spender,
uint256 _value
)
public
returns (bool)
{
}
function approveAndCall(
address _spender,
uint256 _value,
bytes _data
)
public
returns (bool)
{
}
/**
* @dev Internal function to invoke `onTransferReceived` on a target address
* The call is not executed if the target address is not a contract
* @param _from address Representing the previous owner of the given token value
* @param _to address Target address that will receive the tokens
* @param _value uint256 The amount mount of tokens to be transferred
* @param _data bytes Optional data to send along with the call
* @return whether the call correctly returned the expected magic value
*/
function checkAndCallTransfer(
address _from,
address _to,
uint256 _value,
bytes _data
)
internal
returns (bool)
{
}
/**
* @dev Internal function to invoke `onApprovalReceived` on a target address
* The call is not executed if the target address is not a contract
* @param _spender address The address which will spend the funds
* @param _value uint256 The amount of tokens to be spent
* @param _data bytes Optional data to send along with the call
* @return whether the call correctly returned the expected magic value
*/
function checkAndCallApprove(
address _spender,
uint256 _value,
bytes _data
)
internal
returns (bool)
{
}
}
| transfer(_to,_value) | 936 | transfer(_to,_value) |
null | // solium-disable-next-line max-len
/**
* @title ERC1363BasicToken
* @author Vittorio Minacori (https://github.com/vittominacori)
* @dev Implementation of an ERC1363 interface
*/
contract ERC1363BasicToken is SupportsInterfaceWithLookup, StandardToken, ERC1363 { // solium-disable-line max-len
using AddressUtils for address;
/*
* Note: the ERC-165 identifier for this interface is 0x4bbee2df.
* 0x4bbee2df ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)'))
*/
bytes4 internal constant InterfaceId_ERC1363Transfer = 0x4bbee2df;
/*
* Note: the ERC-165 identifier for this interface is 0xfb9ec8ce.
* 0xfb9ec8ce ===
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
bytes4 internal constant InterfaceId_ERC1363Approve = 0xfb9ec8ce;
// Equals to `bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)"))`
// which can be also obtained as `ERC1363Receiver(0).onTransferReceived.selector`
bytes4 private constant ERC1363_RECEIVED = 0x88a7ca5c;
// Equals to `bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))`
// which can be also obtained as `ERC1363Spender(0).onApprovalReceived.selector`
bytes4 private constant ERC1363_APPROVED = 0x7b04a2d0;
constructor() public {
}
function transferAndCall(
address _to,
uint256 _value
)
public
returns (bool)
{
}
function transferAndCall(
address _to,
uint256 _value,
bytes _data
)
public
returns (bool)
{
require(transfer(_to, _value));
require(<FILL_ME>)
return true;
}
function transferFromAndCall(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
function transferFromAndCall(
address _from,
address _to,
uint256 _value,
bytes _data
)
public
returns (bool)
{
}
function approveAndCall(
address _spender,
uint256 _value
)
public
returns (bool)
{
}
function approveAndCall(
address _spender,
uint256 _value,
bytes _data
)
public
returns (bool)
{
}
/**
* @dev Internal function to invoke `onTransferReceived` on a target address
* The call is not executed if the target address is not a contract
* @param _from address Representing the previous owner of the given token value
* @param _to address Target address that will receive the tokens
* @param _value uint256 The amount mount of tokens to be transferred
* @param _data bytes Optional data to send along with the call
* @return whether the call correctly returned the expected magic value
*/
function checkAndCallTransfer(
address _from,
address _to,
uint256 _value,
bytes _data
)
internal
returns (bool)
{
}
/**
* @dev Internal function to invoke `onApprovalReceived` on a target address
* The call is not executed if the target address is not a contract
* @param _spender address The address which will spend the funds
* @param _value uint256 The amount of tokens to be spent
* @param _data bytes Optional data to send along with the call
* @return whether the call correctly returned the expected magic value
*/
function checkAndCallApprove(
address _spender,
uint256 _value,
bytes _data
)
internal
returns (bool)
{
}
}
| checkAndCallTransfer(msg.sender,_to,_value,_data) | 936 | checkAndCallTransfer(msg.sender,_to,_value,_data) |
null | // solium-disable-next-line max-len
/**
* @title ERC1363BasicToken
* @author Vittorio Minacori (https://github.com/vittominacori)
* @dev Implementation of an ERC1363 interface
*/
contract ERC1363BasicToken is SupportsInterfaceWithLookup, StandardToken, ERC1363 { // solium-disable-line max-len
using AddressUtils for address;
/*
* Note: the ERC-165 identifier for this interface is 0x4bbee2df.
* 0x4bbee2df ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)'))
*/
bytes4 internal constant InterfaceId_ERC1363Transfer = 0x4bbee2df;
/*
* Note: the ERC-165 identifier for this interface is 0xfb9ec8ce.
* 0xfb9ec8ce ===
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
bytes4 internal constant InterfaceId_ERC1363Approve = 0xfb9ec8ce;
// Equals to `bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)"))`
// which can be also obtained as `ERC1363Receiver(0).onTransferReceived.selector`
bytes4 private constant ERC1363_RECEIVED = 0x88a7ca5c;
// Equals to `bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))`
// which can be also obtained as `ERC1363Spender(0).onApprovalReceived.selector`
bytes4 private constant ERC1363_APPROVED = 0x7b04a2d0;
constructor() public {
}
function transferAndCall(
address _to,
uint256 _value
)
public
returns (bool)
{
}
function transferAndCall(
address _to,
uint256 _value,
bytes _data
)
public
returns (bool)
{
}
function transferFromAndCall(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
function transferFromAndCall(
address _from,
address _to,
uint256 _value,
bytes _data
)
public
returns (bool)
{
require(<FILL_ME>)
require(
checkAndCallTransfer(
_from,
_to,
_value,
_data
)
);
return true;
}
function approveAndCall(
address _spender,
uint256 _value
)
public
returns (bool)
{
}
function approveAndCall(
address _spender,
uint256 _value,
bytes _data
)
public
returns (bool)
{
}
/**
* @dev Internal function to invoke `onTransferReceived` on a target address
* The call is not executed if the target address is not a contract
* @param _from address Representing the previous owner of the given token value
* @param _to address Target address that will receive the tokens
* @param _value uint256 The amount mount of tokens to be transferred
* @param _data bytes Optional data to send along with the call
* @return whether the call correctly returned the expected magic value
*/
function checkAndCallTransfer(
address _from,
address _to,
uint256 _value,
bytes _data
)
internal
returns (bool)
{
}
/**
* @dev Internal function to invoke `onApprovalReceived` on a target address
* The call is not executed if the target address is not a contract
* @param _spender address The address which will spend the funds
* @param _value uint256 The amount of tokens to be spent
* @param _data bytes Optional data to send along with the call
* @return whether the call correctly returned the expected magic value
*/
function checkAndCallApprove(
address _spender,
uint256 _value,
bytes _data
)
internal
returns (bool)
{
}
}
| transferFrom(_from,_to,_value) | 936 | transferFrom(_from,_to,_value) |
null | // solium-disable-next-line max-len
/**
* @title ERC1363BasicToken
* @author Vittorio Minacori (https://github.com/vittominacori)
* @dev Implementation of an ERC1363 interface
*/
contract ERC1363BasicToken is SupportsInterfaceWithLookup, StandardToken, ERC1363 { // solium-disable-line max-len
using AddressUtils for address;
/*
* Note: the ERC-165 identifier for this interface is 0x4bbee2df.
* 0x4bbee2df ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)'))
*/
bytes4 internal constant InterfaceId_ERC1363Transfer = 0x4bbee2df;
/*
* Note: the ERC-165 identifier for this interface is 0xfb9ec8ce.
* 0xfb9ec8ce ===
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
bytes4 internal constant InterfaceId_ERC1363Approve = 0xfb9ec8ce;
// Equals to `bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)"))`
// which can be also obtained as `ERC1363Receiver(0).onTransferReceived.selector`
bytes4 private constant ERC1363_RECEIVED = 0x88a7ca5c;
// Equals to `bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))`
// which can be also obtained as `ERC1363Spender(0).onApprovalReceived.selector`
bytes4 private constant ERC1363_APPROVED = 0x7b04a2d0;
constructor() public {
}
function transferAndCall(
address _to,
uint256 _value
)
public
returns (bool)
{
}
function transferAndCall(
address _to,
uint256 _value,
bytes _data
)
public
returns (bool)
{
}
function transferFromAndCall(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
function transferFromAndCall(
address _from,
address _to,
uint256 _value,
bytes _data
)
public
returns (bool)
{
require(transferFrom(_from, _to, _value));
require(<FILL_ME>)
return true;
}
function approveAndCall(
address _spender,
uint256 _value
)
public
returns (bool)
{
}
function approveAndCall(
address _spender,
uint256 _value,
bytes _data
)
public
returns (bool)
{
}
/**
* @dev Internal function to invoke `onTransferReceived` on a target address
* The call is not executed if the target address is not a contract
* @param _from address Representing the previous owner of the given token value
* @param _to address Target address that will receive the tokens
* @param _value uint256 The amount mount of tokens to be transferred
* @param _data bytes Optional data to send along with the call
* @return whether the call correctly returned the expected magic value
*/
function checkAndCallTransfer(
address _from,
address _to,
uint256 _value,
bytes _data
)
internal
returns (bool)
{
}
/**
* @dev Internal function to invoke `onApprovalReceived` on a target address
* The call is not executed if the target address is not a contract
* @param _spender address The address which will spend the funds
* @param _value uint256 The amount of tokens to be spent
* @param _data bytes Optional data to send along with the call
* @return whether the call correctly returned the expected magic value
*/
function checkAndCallApprove(
address _spender,
uint256 _value,
bytes _data
)
internal
returns (bool)
{
}
}
| checkAndCallTransfer(_from,_to,_value,_data) | 936 | checkAndCallTransfer(_from,_to,_value,_data) |
null | // solium-disable-next-line max-len
/**
* @title ERC1363BasicToken
* @author Vittorio Minacori (https://github.com/vittominacori)
* @dev Implementation of an ERC1363 interface
*/
contract ERC1363BasicToken is SupportsInterfaceWithLookup, StandardToken, ERC1363 { // solium-disable-line max-len
using AddressUtils for address;
/*
* Note: the ERC-165 identifier for this interface is 0x4bbee2df.
* 0x4bbee2df ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)'))
*/
bytes4 internal constant InterfaceId_ERC1363Transfer = 0x4bbee2df;
/*
* Note: the ERC-165 identifier for this interface is 0xfb9ec8ce.
* 0xfb9ec8ce ===
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
bytes4 internal constant InterfaceId_ERC1363Approve = 0xfb9ec8ce;
// Equals to `bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)"))`
// which can be also obtained as `ERC1363Receiver(0).onTransferReceived.selector`
bytes4 private constant ERC1363_RECEIVED = 0x88a7ca5c;
// Equals to `bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))`
// which can be also obtained as `ERC1363Spender(0).onApprovalReceived.selector`
bytes4 private constant ERC1363_APPROVED = 0x7b04a2d0;
constructor() public {
}
function transferAndCall(
address _to,
uint256 _value
)
public
returns (bool)
{
}
function transferAndCall(
address _to,
uint256 _value,
bytes _data
)
public
returns (bool)
{
}
function transferFromAndCall(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
function transferFromAndCall(
address _from,
address _to,
uint256 _value,
bytes _data
)
public
returns (bool)
{
}
function approveAndCall(
address _spender,
uint256 _value
)
public
returns (bool)
{
}
function approveAndCall(
address _spender,
uint256 _value,
bytes _data
)
public
returns (bool)
{
approve(_spender, _value);
require(<FILL_ME>)
return true;
}
/**
* @dev Internal function to invoke `onTransferReceived` on a target address
* The call is not executed if the target address is not a contract
* @param _from address Representing the previous owner of the given token value
* @param _to address Target address that will receive the tokens
* @param _value uint256 The amount mount of tokens to be transferred
* @param _data bytes Optional data to send along with the call
* @return whether the call correctly returned the expected magic value
*/
function checkAndCallTransfer(
address _from,
address _to,
uint256 _value,
bytes _data
)
internal
returns (bool)
{
}
/**
* @dev Internal function to invoke `onApprovalReceived` on a target address
* The call is not executed if the target address is not a contract
* @param _spender address The address which will spend the funds
* @param _value uint256 The amount of tokens to be spent
* @param _data bytes Optional data to send along with the call
* @return whether the call correctly returned the expected magic value
*/
function checkAndCallApprove(
address _spender,
uint256 _value,
bytes _data
)
internal
returns (bool)
{
}
}
| checkAndCallApprove(_spender,_value,_data) | 936 | checkAndCallApprove(_spender,_value,_data) |
"No authority" | pragma solidity 0.6.0;
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) {
}
}
// voting contract
interface Nest_3_VoteFactory {
// Check address
function checkAddress(string calldata name) external view returns (address contractAddress);
// check whether the administrator
function checkOwners(address man) external view returns (bool);
}
/**
* @title NToken contract
* @dev Include standard erc20 method, mining method, and mining data
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Nest_NToken is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances; // Balance ledger
mapping (address => mapping (address => uint256)) private _allowed; // Approval ledger
uint256 private _totalSupply = 0 ether; // Total supply
string public name; // Token name
string public symbol; // Token symbol
uint8 public decimals = 18; // Precision
uint256 public _createBlock; // Create block number
uint256 public _recentlyUsedBlock; // Recently used block number
Nest_3_VoteFactory _voteFactory; // Voting factory contract
address _bidder; // Owner
/**
* @dev Initialization method
* @param _name Token name
* @param _symbol Token symbol
* @param voteFactory Voting factory contract address
* @param bidder Successful bidder address
*/
constructor (string memory _name, string memory _symbol, address voteFactory, address bidder) public {
}
/**
* @dev Reset voting contract method
* @param voteFactory Voting contract address
*/
function changeMapping (address voteFactory) public onlyOwner {
}
/**
* @dev Additional issuance
* @param value Additional issuance amount
*/
function increaseTotal(uint256 value) public {
address offerMain = address(_voteFactory.checkAddress("nest.nToken.offerMain"));
require(<FILL_ME>)
_balances[offerMain] = _balances[offerMain].add(value);
_totalSupply = _totalSupply.add(value);
_recentlyUsedBlock = block.number;
}
/**
* @dev Check the total amount of tokens
* @return Total supply
*/
function totalSupply() override public view returns (uint256) {
}
/**
* @dev Check address balance
* @param owner Address to be checked
* @return Return the balance of the corresponding address
*/
function balanceOf(address owner) override public view returns (uint256) {
}
/**
* @dev Check block information
* @return createBlock Initial block number
* @return recentlyUsedBlock Recently mined and issued block
*/
function checkBlockInfo() public view returns(uint256 createBlock, uint256 recentlyUsedBlock) {
}
/**
* @dev Check owner's approved allowance to the spender
* @param owner Approving address
* @param spender Approved address
* @return Approved amount
*/
function allowance(address owner, address spender) override public view returns (uint256) {
}
/**
* @dev Transfer method
* @param to Transfer target
* @param value Transfer amount
* @return Whether the transfer is successful
*/
function transfer(address to, uint256 value) override public returns (bool) {
}
/**
* @dev Approval method
* @param spender Approval target
* @param value Approval amount
* @return Whether the approval is successful
*/
function approve(address spender, uint256 value) override public returns (bool) {
}
/**
* @dev Transfer tokens when approved
* @param from Transfer-out account address
* @param to Transfer-in account address
* @param value Transfer amount
* @return Whether approved transfer is successful
*/
function transferFrom(address from, address to, uint256 value) override public returns (bool) {
}
/**
* @dev Increase the allowance
* @param spender Approval target
* @param addedValue Amount to increase
* @return whether increase is successful
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
/**
* @dev Decrease the allowance
* @param spender Approval target
* @param subtractedValue Amount to decrease
* @return Whether decrease is successful
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
/**
* @dev Transfer method
* @param to Transfer target
* @param value Transfer amount
*/
function _transfer(address from, address to, uint256 value) internal {
}
/**
* @dev Check the creator
* @return Creator address
*/
function checkBidder() public view returns(address) {
}
/**
* @dev Transfer creator
* @param bidder New creator address
*/
function changeBidder(address bidder) public {
}
// Administrator only
modifier onlyOwner(){
}
}
| address(msg.sender)==offerMain,"No authority" | 961 | address(msg.sender)==offerMain |
null | pragma solidity 0.6.0;
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) {
}
}
// voting contract
interface Nest_3_VoteFactory {
// Check address
function checkAddress(string calldata name) external view returns (address contractAddress);
// check whether the administrator
function checkOwners(address man) external view returns (bool);
}
/**
* @title NToken contract
* @dev Include standard erc20 method, mining method, and mining data
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Nest_NToken is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances; // Balance ledger
mapping (address => mapping (address => uint256)) private _allowed; // Approval ledger
uint256 private _totalSupply = 0 ether; // Total supply
string public name; // Token name
string public symbol; // Token symbol
uint8 public decimals = 18; // Precision
uint256 public _createBlock; // Create block number
uint256 public _recentlyUsedBlock; // Recently used block number
Nest_3_VoteFactory _voteFactory; // Voting factory contract
address _bidder; // Owner
/**
* @dev Initialization method
* @param _name Token name
* @param _symbol Token symbol
* @param voteFactory Voting factory contract address
* @param bidder Successful bidder address
*/
constructor (string memory _name, string memory _symbol, address voteFactory, address bidder) public {
}
/**
* @dev Reset voting contract method
* @param voteFactory Voting contract address
*/
function changeMapping (address voteFactory) public onlyOwner {
}
/**
* @dev Additional issuance
* @param value Additional issuance amount
*/
function increaseTotal(uint256 value) public {
}
/**
* @dev Check the total amount of tokens
* @return Total supply
*/
function totalSupply() override public view returns (uint256) {
}
/**
* @dev Check address balance
* @param owner Address to be checked
* @return Return the balance of the corresponding address
*/
function balanceOf(address owner) override public view returns (uint256) {
}
/**
* @dev Check block information
* @return createBlock Initial block number
* @return recentlyUsedBlock Recently mined and issued block
*/
function checkBlockInfo() public view returns(uint256 createBlock, uint256 recentlyUsedBlock) {
}
/**
* @dev Check owner's approved allowance to the spender
* @param owner Approving address
* @param spender Approved address
* @return Approved amount
*/
function allowance(address owner, address spender) override public view returns (uint256) {
}
/**
* @dev Transfer method
* @param to Transfer target
* @param value Transfer amount
* @return Whether the transfer is successful
*/
function transfer(address to, uint256 value) override public returns (bool) {
}
/**
* @dev Approval method
* @param spender Approval target
* @param value Approval amount
* @return Whether the approval is successful
*/
function approve(address spender, uint256 value) override public returns (bool) {
}
/**
* @dev Transfer tokens when approved
* @param from Transfer-out account address
* @param to Transfer-in account address
* @param value Transfer amount
* @return Whether approved transfer is successful
*/
function transferFrom(address from, address to, uint256 value) override public returns (bool) {
}
/**
* @dev Increase the allowance
* @param spender Approval target
* @param addedValue Amount to increase
* @return whether increase is successful
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
/**
* @dev Decrease the allowance
* @param spender Approval target
* @param subtractedValue Amount to decrease
* @return Whether decrease is successful
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
/**
* @dev Transfer method
* @param to Transfer target
* @param value Transfer amount
*/
function _transfer(address from, address to, uint256 value) internal {
}
/**
* @dev Check the creator
* @return Creator address
*/
function checkBidder() public view returns(address) {
}
/**
* @dev Transfer creator
* @param bidder New creator address
*/
function changeBidder(address bidder) public {
require(<FILL_ME>)
_bidder = bidder;
}
// Administrator only
modifier onlyOwner(){
}
}
| address(msg.sender)==_bidder | 961 | address(msg.sender)==_bidder |
null | pragma solidity 0.6.0;
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) {
}
}
// voting contract
interface Nest_3_VoteFactory {
// Check address
function checkAddress(string calldata name) external view returns (address contractAddress);
// check whether the administrator
function checkOwners(address man) external view returns (bool);
}
/**
* @title NToken contract
* @dev Include standard erc20 method, mining method, and mining data
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Nest_NToken is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances; // Balance ledger
mapping (address => mapping (address => uint256)) private _allowed; // Approval ledger
uint256 private _totalSupply = 0 ether; // Total supply
string public name; // Token name
string public symbol; // Token symbol
uint8 public decimals = 18; // Precision
uint256 public _createBlock; // Create block number
uint256 public _recentlyUsedBlock; // Recently used block number
Nest_3_VoteFactory _voteFactory; // Voting factory contract
address _bidder; // Owner
/**
* @dev Initialization method
* @param _name Token name
* @param _symbol Token symbol
* @param voteFactory Voting factory contract address
* @param bidder Successful bidder address
*/
constructor (string memory _name, string memory _symbol, address voteFactory, address bidder) public {
}
/**
* @dev Reset voting contract method
* @param voteFactory Voting contract address
*/
function changeMapping (address voteFactory) public onlyOwner {
}
/**
* @dev Additional issuance
* @param value Additional issuance amount
*/
function increaseTotal(uint256 value) public {
}
/**
* @dev Check the total amount of tokens
* @return Total supply
*/
function totalSupply() override public view returns (uint256) {
}
/**
* @dev Check address balance
* @param owner Address to be checked
* @return Return the balance of the corresponding address
*/
function balanceOf(address owner) override public view returns (uint256) {
}
/**
* @dev Check block information
* @return createBlock Initial block number
* @return recentlyUsedBlock Recently mined and issued block
*/
function checkBlockInfo() public view returns(uint256 createBlock, uint256 recentlyUsedBlock) {
}
/**
* @dev Check owner's approved allowance to the spender
* @param owner Approving address
* @param spender Approved address
* @return Approved amount
*/
function allowance(address owner, address spender) override public view returns (uint256) {
}
/**
* @dev Transfer method
* @param to Transfer target
* @param value Transfer amount
* @return Whether the transfer is successful
*/
function transfer(address to, uint256 value) override public returns (bool) {
}
/**
* @dev Approval method
* @param spender Approval target
* @param value Approval amount
* @return Whether the approval is successful
*/
function approve(address spender, uint256 value) override public returns (bool) {
}
/**
* @dev Transfer tokens when approved
* @param from Transfer-out account address
* @param to Transfer-in account address
* @param value Transfer amount
* @return Whether approved transfer is successful
*/
function transferFrom(address from, address to, uint256 value) override public returns (bool) {
}
/**
* @dev Increase the allowance
* @param spender Approval target
* @param addedValue Amount to increase
* @return whether increase is successful
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
/**
* @dev Decrease the allowance
* @param spender Approval target
* @param subtractedValue Amount to decrease
* @return Whether decrease is successful
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
/**
* @dev Transfer method
* @param to Transfer target
* @param value Transfer amount
*/
function _transfer(address from, address to, uint256 value) internal {
}
/**
* @dev Check the creator
* @return Creator address
*/
function checkBidder() public view returns(address) {
}
/**
* @dev Transfer creator
* @param bidder New creator address
*/
function changeBidder(address bidder) public {
}
// Administrator only
modifier onlyOwner(){
require(<FILL_ME>)
_;
}
}
| _voteFactory.checkOwners(msg.sender) | 961 | _voteFactory.checkOwners(msg.sender) |
null | pragma solidity ^0.7.6;
interface AvastarsContract {
function useTraits(uint256 _primeId, bool[12] calldata _traitFlags) external;
function getPrimeReplicationByTokenId(uint256 _tokenId) external view returns (uint256 tokenId, bool[12] memory replicated);
}
interface ARTContract {
function burnArt(uint256 artToBurn) external;
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
contract AvastarsInterface {
constructor() {
}
modifier isOwner() {
}
address public AvastarsAddress = 0xF3E778F839934fC819cFA1040AabaCeCBA01e049; //mainnet: 0xF3E778F839934fC819cFA1040AabaCeCBA01e049
address public ARTAddress = 0x69ad42A8726f161Bd4C76305DFa8F4ecc120115c; //mainnet: 0x69ad42A8726f161Bd4C76305DFa8F4ecc120115c
address public owner;
uint256 public paymentIncrement;
address payable paymentWallet = 0x4C7BEdfA26C744e6bd61CBdF86F3fc4a76DCa073; //nft42 wallet: 0x4C7BEdfA26C744e6bd61CBdF86F3fc4a76DCa073
event TraitsBurned(address msgsender, uint256 paymentTier);
AvastarsContract Avastars;
ARTContract AvastarReplicantToken;
function burnReplicantTraits(uint256 paymentTier, uint[] memory avastarIDs, bool[12][] memory avastarTraits) public payable {
require(msg.value >= paymentTier * paymentIncrement);
require(avastarIDs.length == avastarTraits.length);
uint256 totalAvastars = avastarIDs.length;
bool[12] memory traitIsUsed;
bool[12] memory traitsToBurn;
for (uint i = 0; i < totalAvastars; i = i + 1){
(, traitIsUsed) = Avastars.getPrimeReplicationByTokenId(avastarIDs[i]);
traitsToBurn = avastarTraits[i];
for(uint j = 0; j < 12; j = j + 1) {
if(traitIsUsed[j] == true) {
require(<FILL_ME>)
}
}
Avastars.useTraits(avastarIDs[i],avastarTraits[i]);
}
AvastarReplicantToken.transferFrom(msg.sender,address(this),1000000000000000000);
AvastarReplicantToken.burnArt(1);
paymentWallet.transfer(msg.value);
emit TraitsBurned(msg.sender, paymentTier);
}
function setPaymentIncrement(uint256 newIncrement) public isOwner {
}
function setOwner(address newOwner) public isOwner {
}
function setPaymentWallet(address payable newWallet) public isOwner {
}
}
| traitsToBurn[j]==false | 970 | traitsToBurn[j]==false |
"Must maintain correct % of PVC during lockup periods" | /**
*Submitted for verification at Etherscan.io on 2019-10-12
*/
/**
*Submitted for verification at Etherscan.io on 2019-10-09
*/
/**
*Submitted for verification at Etherscan.io on 2019-02-04
*/
pragma solidity ^0.5.3;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _amount) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
uint balanceOfParticipant;
uint lockedAmount;
uint allowedAmount;
bool lockupIsActive = false;
uint256 lockupStartTime;
// balances for each address
mapping(address => uint256) balances;
struct Lockup {
uint256 lockupAmount;
}
Lockup lockup;
mapping(address => Lockup) lockupParticipants;
event LockupStarted(uint256 indexed lockupStartTime);
function requireWithinLockupRange(address _spender, uint256 _amount) internal {
if (lockupIsActive) {
uint timePassed = now - lockupStartTime;
balanceOfParticipant = balances[_spender];
lockedAmount = lockupParticipants[_spender].lockupAmount;
allowedAmount = lockedAmount;
if (timePassed < 92 days) {
allowedAmount = lockedAmount.mul(5).div(100);
} else if (timePassed >= 92 days && timePassed < 183 days) {
allowedAmount = lockedAmount.mul(30).div(100);
} else if (timePassed >= 183 days && timePassed < 365 days) {
allowedAmount = lockedAmount.mul(55).div(100);
}
require(<FILL_ME>)
}
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner {
}
}
/**
* @title OXYGEN
* @dev Token representing OXYGEN.
*/
contract OXYGEN is BurnableToken {
string public name;
string public symbol;
uint8 public decimals = 18;
/**
* @dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function() external payable {
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
*/
constructor(address wallet) public {
}
/**
* @dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string memory, string memory, uint256) {
}
function vest(address[] memory _owners, uint[] memory _amounts) public onlyOwner {
}
function initiateLockup() public onlyOwner {
}
function lockupActive() public view returns (bool) {
}
function lockupAmountOf(address _owner) public view returns (uint256) {
}
}
| balanceOfParticipant.sub(_amount)>=lockedAmount.sub(allowedAmount),"Must maintain correct % of PVC during lockup periods" | 1,007 | balanceOfParticipant.sub(_amount)>=lockedAmount.sub(allowedAmount) |
"Cannot transfer (Not enough balance)" | /**
*Submitted for verification at Etherscan.io on 2019-10-12
*/
/**
*Submitted for verification at Etherscan.io on 2019-10-09
*/
/**
*Submitted for verification at Etherscan.io on 2019-02-04
*/
pragma solidity ^0.5.3;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _amount) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
uint balanceOfParticipant;
uint lockedAmount;
uint allowedAmount;
bool lockupIsActive = false;
uint256 lockupStartTime;
// balances for each address
mapping(address => uint256) balances;
struct Lockup {
uint256 lockupAmount;
}
Lockup lockup;
mapping(address => Lockup) lockupParticipants;
event LockupStarted(uint256 indexed lockupStartTime);
function requireWithinLockupRange(address _spender, uint256 _amount) internal {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool success) {
require(_to != msg.sender, "Cannot transfer to self");
require(_to != address(this), "Cannot transfer to Contract");
require(_to != address(0), "Cannot transfer to 0x0");
require(<FILL_ME>)
requireWithinLockupRange(msg.sender, _amount);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner {
}
}
/**
* @title OXYGEN
* @dev Token representing OXYGEN.
*/
contract OXYGEN is BurnableToken {
string public name;
string public symbol;
uint8 public decimals = 18;
/**
* @dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function() external payable {
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
*/
constructor(address wallet) public {
}
/**
* @dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string memory, string memory, uint256) {
}
function vest(address[] memory _owners, uint[] memory _amounts) public onlyOwner {
}
function initiateLockup() public onlyOwner {
}
function lockupActive() public view returns (bool) {
}
function lockupAmountOf(address _owner) public view returns (uint256) {
}
}
| balances[msg.sender]>=_amount&&_amount>0&&balances[_to].add(_amount)>balances[_to],"Cannot transfer (Not enough balance)" | 1,007 | balances[msg.sender]>=_amount&&_amount>0&&balances[_to].add(_amount)>balances[_to] |
_amount | /**
*Submitted for verification at Etherscan.io on 2019-10-12
*/
/**
*Submitted for verification at Etherscan.io on 2019-10-09
*/
/**
*Submitted for verification at Etherscan.io on 2019-02-04
*/
pragma solidity ^0.5.3;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _amount) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
uint balanceOfParticipant;
uint lockedAmount;
uint allowedAmount;
bool lockupIsActive = false;
uint256 lockupStartTime;
// balances for each address
mapping(address => uint256) balances;
struct Lockup {
uint256 lockupAmount;
}
Lockup lockup;
mapping(address => Lockup) lockupParticipants;
event LockupStarted(uint256 indexed lockupStartTime);
function requireWithinLockupRange(address _spender, uint256 _amount) internal {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool success) {
require(_to != msg.sender, "Cannot transfer to self");
require(_to != address(this), "Cannot transfer to Contract");
require(_to != address(0), "Cannot transfer to 0x0");
require(
balances[msg.sender] >= _amount && _amount > 0 && balances[_to].add(_amount) > balances[_to],
"Cannot transfer (Not enough balance)"
);
require(<FILL_ME>)
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner {
}
}
/**
* @title OXYGEN
* @dev Token representing OXYGEN.
*/
contract OXYGEN is BurnableToken {
string public name;
string public symbol;
uint8 public decimals = 18;
/**
* @dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function() external payable {
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
*/
constructor(address wallet) public {
}
/**
* @dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string memory, string memory, uint256) {
}
function vest(address[] memory _owners, uint[] memory _amounts) public onlyOwner {
}
function initiateLockup() public onlyOwner {
}
function lockupActive() public view returns (bool) {
}
function lockupAmountOf(address _owner) public view returns (uint256) {
}
}
| ithinLockupRange(msg.sender,_amount | 1,007 | msg.sender |
"Not enough balance to transfer from" | /**
*Submitted for verification at Etherscan.io on 2019-10-12
*/
/**
*Submitted for verification at Etherscan.io on 2019-10-09
*/
/**
*Submitted for verification at Etherscan.io on 2019-02-04
*/
pragma solidity ^0.5.3;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _amount) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
uint balanceOfParticipant;
uint lockedAmount;
uint allowedAmount;
bool lockupIsActive = false;
uint256 lockupStartTime;
// balances for each address
mapping(address => uint256) balances;
struct Lockup {
uint256 lockupAmount;
}
Lockup lockup;
mapping(address => Lockup) lockupParticipants;
event LockupStarted(uint256 indexed lockupStartTime);
function requireWithinLockupRange(address _spender, uint256 _amount) internal {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
require(_from != msg.sender, "Cannot transfer from self, use transfer function instead");
require(_from != address(this) && _to != address(this), "Cannot transfer from or to Contract");
require(_to != address(0), "Cannot transfer to 0x0");
require(<FILL_ME>)
require(allowed[_from][msg.sender] >= _amount, "Not enough allowance to transfer from");
require(_amount > 0 && balances[_to].add(_amount) > balances[_to], "Amount must be > 0 to transfer from");
requireWithinLockupRange(_from, _amount);
balances[_from] = balances[_from].sub(_amount);
balances[_to] = balances[_to].add(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner {
}
}
/**
* @title OXYGEN
* @dev Token representing OXYGEN.
*/
contract OXYGEN is BurnableToken {
string public name;
string public symbol;
uint8 public decimals = 18;
/**
* @dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function() external payable {
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
*/
constructor(address wallet) public {
}
/**
* @dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string memory, string memory, uint256) {
}
function vest(address[] memory _owners, uint[] memory _amounts) public onlyOwner {
}
function initiateLockup() public onlyOwner {
}
function lockupActive() public view returns (bool) {
}
function lockupAmountOf(address _owner) public view returns (uint256) {
}
}
| balances[_from]>=_amount,"Not enough balance to transfer from" | 1,007 | balances[_from]>=_amount |
"Not enough allowance to transfer from" | /**
*Submitted for verification at Etherscan.io on 2019-10-12
*/
/**
*Submitted for verification at Etherscan.io on 2019-10-09
*/
/**
*Submitted for verification at Etherscan.io on 2019-02-04
*/
pragma solidity ^0.5.3;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _amount) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
uint balanceOfParticipant;
uint lockedAmount;
uint allowedAmount;
bool lockupIsActive = false;
uint256 lockupStartTime;
// balances for each address
mapping(address => uint256) balances;
struct Lockup {
uint256 lockupAmount;
}
Lockup lockup;
mapping(address => Lockup) lockupParticipants;
event LockupStarted(uint256 indexed lockupStartTime);
function requireWithinLockupRange(address _spender, uint256 _amount) internal {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
require(_from != msg.sender, "Cannot transfer from self, use transfer function instead");
require(_from != address(this) && _to != address(this), "Cannot transfer from or to Contract");
require(_to != address(0), "Cannot transfer to 0x0");
require(balances[_from] >= _amount, "Not enough balance to transfer from");
require(<FILL_ME>)
require(_amount > 0 && balances[_to].add(_amount) > balances[_to], "Amount must be > 0 to transfer from");
requireWithinLockupRange(_from, _amount);
balances[_from] = balances[_from].sub(_amount);
balances[_to] = balances[_to].add(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner {
}
}
/**
* @title OXYGEN
* @dev Token representing OXYGEN.
*/
contract OXYGEN is BurnableToken {
string public name;
string public symbol;
uint8 public decimals = 18;
/**
* @dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function() external payable {
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
*/
constructor(address wallet) public {
}
/**
* @dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string memory, string memory, uint256) {
}
function vest(address[] memory _owners, uint[] memory _amounts) public onlyOwner {
}
function initiateLockup() public onlyOwner {
}
function lockupActive() public view returns (bool) {
}
function lockupAmountOf(address _owner) public view returns (uint256) {
}
}
| allowed[_from][msg.sender]>=_amount,"Not enough allowance to transfer from" | 1,007 | allowed[_from][msg.sender]>=_amount |
"Vesting funds cannot be sent to 0x0" | /**
*Submitted for verification at Etherscan.io on 2019-10-12
*/
/**
*Submitted for verification at Etherscan.io on 2019-10-09
*/
/**
*Submitted for verification at Etherscan.io on 2019-02-04
*/
pragma solidity ^0.5.3;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _amount) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
uint balanceOfParticipant;
uint lockedAmount;
uint allowedAmount;
bool lockupIsActive = false;
uint256 lockupStartTime;
// balances for each address
mapping(address => uint256) balances;
struct Lockup {
uint256 lockupAmount;
}
Lockup lockup;
mapping(address => Lockup) lockupParticipants;
event LockupStarted(uint256 indexed lockupStartTime);
function requireWithinLockupRange(address _spender, uint256 _amount) internal {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner {
}
}
/**
* @title OXYGEN
* @dev Token representing OXYGEN.
*/
contract OXYGEN is BurnableToken {
string public name;
string public symbol;
uint8 public decimals = 18;
/**
* @dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function() external payable {
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
*/
constructor(address wallet) public {
}
/**
* @dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string memory, string memory, uint256) {
}
function vest(address[] memory _owners, uint[] memory _amounts) public onlyOwner {
require(_owners.length == _amounts.length, "Length of addresses & token amounts are not the same");
for (uint i = 0; i < _owners.length; i++) {
_amounts[i] = _amounts[i].mul(10 ** 18);
require(<FILL_ME>)
require(_amounts[i] > 0, "Amount must be > 0");
require(balances[owner] > _amounts[i], "Not enough balance to vest");
require(balances[_owners[i]].add(_amounts[i]) > balances[_owners[i]], "Internal vesting error");
// SafeMath.sub will throw if there is not enough balance.
balances[owner] = balances[owner].sub(_amounts[i]);
balances[_owners[i]] = balances[_owners[i]].add(_amounts[i]);
emit Transfer(owner, _owners[i], _amounts[i]);
lockup = Lockup({ lockupAmount: _amounts[i] });
lockupParticipants[_owners[i]] = lockup;
}
}
function initiateLockup() public onlyOwner {
}
function lockupActive() public view returns (bool) {
}
function lockupAmountOf(address _owner) public view returns (uint256) {
}
}
| _owners[i]!=address(0),"Vesting funds cannot be sent to 0x0" | 1,007 | _owners[i]!=address(0) |
"Amount must be > 0" | /**
*Submitted for verification at Etherscan.io on 2019-10-12
*/
/**
*Submitted for verification at Etherscan.io on 2019-10-09
*/
/**
*Submitted for verification at Etherscan.io on 2019-02-04
*/
pragma solidity ^0.5.3;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _amount) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
uint balanceOfParticipant;
uint lockedAmount;
uint allowedAmount;
bool lockupIsActive = false;
uint256 lockupStartTime;
// balances for each address
mapping(address => uint256) balances;
struct Lockup {
uint256 lockupAmount;
}
Lockup lockup;
mapping(address => Lockup) lockupParticipants;
event LockupStarted(uint256 indexed lockupStartTime);
function requireWithinLockupRange(address _spender, uint256 _amount) internal {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner {
}
}
/**
* @title OXYGEN
* @dev Token representing OXYGEN.
*/
contract OXYGEN is BurnableToken {
string public name;
string public symbol;
uint8 public decimals = 18;
/**
* @dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function() external payable {
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
*/
constructor(address wallet) public {
}
/**
* @dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string memory, string memory, uint256) {
}
function vest(address[] memory _owners, uint[] memory _amounts) public onlyOwner {
require(_owners.length == _amounts.length, "Length of addresses & token amounts are not the same");
for (uint i = 0; i < _owners.length; i++) {
_amounts[i] = _amounts[i].mul(10 ** 18);
require(_owners[i] != address(0), "Vesting funds cannot be sent to 0x0");
require(<FILL_ME>)
require(balances[owner] > _amounts[i], "Not enough balance to vest");
require(balances[_owners[i]].add(_amounts[i]) > balances[_owners[i]], "Internal vesting error");
// SafeMath.sub will throw if there is not enough balance.
balances[owner] = balances[owner].sub(_amounts[i]);
balances[_owners[i]] = balances[_owners[i]].add(_amounts[i]);
emit Transfer(owner, _owners[i], _amounts[i]);
lockup = Lockup({ lockupAmount: _amounts[i] });
lockupParticipants[_owners[i]] = lockup;
}
}
function initiateLockup() public onlyOwner {
}
function lockupActive() public view returns (bool) {
}
function lockupAmountOf(address _owner) public view returns (uint256) {
}
}
| _amounts[i]>0,"Amount must be > 0" | 1,007 | _amounts[i]>0 |
"Not enough balance to vest" | /**
*Submitted for verification at Etherscan.io on 2019-10-12
*/
/**
*Submitted for verification at Etherscan.io on 2019-10-09
*/
/**
*Submitted for verification at Etherscan.io on 2019-02-04
*/
pragma solidity ^0.5.3;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _amount) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
uint balanceOfParticipant;
uint lockedAmount;
uint allowedAmount;
bool lockupIsActive = false;
uint256 lockupStartTime;
// balances for each address
mapping(address => uint256) balances;
struct Lockup {
uint256 lockupAmount;
}
Lockup lockup;
mapping(address => Lockup) lockupParticipants;
event LockupStarted(uint256 indexed lockupStartTime);
function requireWithinLockupRange(address _spender, uint256 _amount) internal {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner {
}
}
/**
* @title OXYGEN
* @dev Token representing OXYGEN.
*/
contract OXYGEN is BurnableToken {
string public name;
string public symbol;
uint8 public decimals = 18;
/**
* @dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function() external payable {
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
*/
constructor(address wallet) public {
}
/**
* @dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string memory, string memory, uint256) {
}
function vest(address[] memory _owners, uint[] memory _amounts) public onlyOwner {
require(_owners.length == _amounts.length, "Length of addresses & token amounts are not the same");
for (uint i = 0; i < _owners.length; i++) {
_amounts[i] = _amounts[i].mul(10 ** 18);
require(_owners[i] != address(0), "Vesting funds cannot be sent to 0x0");
require(_amounts[i] > 0, "Amount must be > 0");
require(<FILL_ME>)
require(balances[_owners[i]].add(_amounts[i]) > balances[_owners[i]], "Internal vesting error");
// SafeMath.sub will throw if there is not enough balance.
balances[owner] = balances[owner].sub(_amounts[i]);
balances[_owners[i]] = balances[_owners[i]].add(_amounts[i]);
emit Transfer(owner, _owners[i], _amounts[i]);
lockup = Lockup({ lockupAmount: _amounts[i] });
lockupParticipants[_owners[i]] = lockup;
}
}
function initiateLockup() public onlyOwner {
}
function lockupActive() public view returns (bool) {
}
function lockupAmountOf(address _owner) public view returns (uint256) {
}
}
| balances[owner]>_amounts[i],"Not enough balance to vest" | 1,007 | balances[owner]>_amounts[i] |
"Internal vesting error" | /**
*Submitted for verification at Etherscan.io on 2019-10-12
*/
/**
*Submitted for verification at Etherscan.io on 2019-10-09
*/
/**
*Submitted for verification at Etherscan.io on 2019-02-04
*/
pragma solidity ^0.5.3;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _amount) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
uint balanceOfParticipant;
uint lockedAmount;
uint allowedAmount;
bool lockupIsActive = false;
uint256 lockupStartTime;
// balances for each address
mapping(address => uint256) balances;
struct Lockup {
uint256 lockupAmount;
}
Lockup lockup;
mapping(address => Lockup) lockupParticipants;
event LockupStarted(uint256 indexed lockupStartTime);
function requireWithinLockupRange(address _spender, uint256 _amount) internal {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner {
}
}
/**
* @title OXYGEN
* @dev Token representing OXYGEN.
*/
contract OXYGEN is BurnableToken {
string public name;
string public symbol;
uint8 public decimals = 18;
/**
* @dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function() external payable {
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
*/
constructor(address wallet) public {
}
/**
* @dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string memory, string memory, uint256) {
}
function vest(address[] memory _owners, uint[] memory _amounts) public onlyOwner {
require(_owners.length == _amounts.length, "Length of addresses & token amounts are not the same");
for (uint i = 0; i < _owners.length; i++) {
_amounts[i] = _amounts[i].mul(10 ** 18);
require(_owners[i] != address(0), "Vesting funds cannot be sent to 0x0");
require(_amounts[i] > 0, "Amount must be > 0");
require(balances[owner] > _amounts[i], "Not enough balance to vest");
require(<FILL_ME>)
// SafeMath.sub will throw if there is not enough balance.
balances[owner] = balances[owner].sub(_amounts[i]);
balances[_owners[i]] = balances[_owners[i]].add(_amounts[i]);
emit Transfer(owner, _owners[i], _amounts[i]);
lockup = Lockup({ lockupAmount: _amounts[i] });
lockupParticipants[_owners[i]] = lockup;
}
}
function initiateLockup() public onlyOwner {
}
function lockupActive() public view returns (bool) {
}
function lockupAmountOf(address _owner) public view returns (uint256) {
}
}
| balances[_owners[i]].add(_amounts[i])>balances[_owners[i]],"Internal vesting error" | 1,007 | balances[_owners[i]].add(_amounts[i])>balances[_owners[i]] |
ERROR_ALREADY_INITIALIZED | /*
* SPDX-License-Identitifer: MIT
*/
pragma solidity ^0.4.24;
contract Initializable is TimeHelpers {
using UnstructuredStorage for bytes32;
// keccak256("aragonOS.initializable.initializationBlock")
bytes32 internal constant INITIALIZATION_BLOCK_POSITION = 0xebb05b386a8d34882b8711d156f463690983dc47815980fb82aeeff1aa43579e;
string private constant ERROR_ALREADY_INITIALIZED = "INIT_ALREADY_INITIALIZED";
string private constant ERROR_NOT_INITIALIZED = "INIT_NOT_INITIALIZED";
modifier onlyInit {
require(<FILL_ME>)
_;
}
modifier isInitialized {
}
/**
* @return Block number in which the contract was initialized
*/
function getInitializationBlock() public view returns (uint256) {
}
/**
* @return Whether the contract has been initialized by the time of the current block
*/
function hasInitialized() public view returns (bool) {
}
/**
* @dev Function to be called by top level contract after initialization has finished.
*/
function initialized() internal onlyInit {
}
/**
* @dev Function to be called by top level contract after initialization to enable the contract
* at a future block number rather than immediately.
*/
function initializedAt(uint256 _blockNumber) internal onlyInit {
}
}
| getInitializationBlock()==0,ERROR_ALREADY_INITIALIZED | 1,031 | getInitializationBlock()==0 |
ERROR_NOT_INITIALIZED | /*
* SPDX-License-Identitifer: MIT
*/
pragma solidity ^0.4.24;
contract Initializable is TimeHelpers {
using UnstructuredStorage for bytes32;
// keccak256("aragonOS.initializable.initializationBlock")
bytes32 internal constant INITIALIZATION_BLOCK_POSITION = 0xebb05b386a8d34882b8711d156f463690983dc47815980fb82aeeff1aa43579e;
string private constant ERROR_ALREADY_INITIALIZED = "INIT_ALREADY_INITIALIZED";
string private constant ERROR_NOT_INITIALIZED = "INIT_NOT_INITIALIZED";
modifier onlyInit {
}
modifier isInitialized {
require(<FILL_ME>)
_;
}
/**
* @return Block number in which the contract was initialized
*/
function getInitializationBlock() public view returns (uint256) {
}
/**
* @return Whether the contract has been initialized by the time of the current block
*/
function hasInitialized() public view returns (bool) {
}
/**
* @dev Function to be called by top level contract after initialization has finished.
*/
function initialized() internal onlyInit {
}
/**
* @dev Function to be called by top level contract after initialization to enable the contract
* at a future block number rather than immediately.
*/
function initializedAt(uint256 _blockNumber) internal onlyInit {
}
}
| hasInitialized(),ERROR_NOT_INITIALIZED | 1,031 | hasInitialized() |
ERROR_APP_NOT_CONTRACT | pragma solidity 0.4.24;
// solium-disable-next-line max-len
contract Kernel is IKernel, KernelStorage, KernelAppIds, KernelNamespaceConstants, Petrifiable, IsContract, VaultRecoverable, AppProxyFactory, ACLSyntaxSugar {
/* Hardcoded constants to save gas
bytes32 public constant APP_MANAGER_ROLE = keccak256("APP_MANAGER_ROLE");
*/
bytes32 public constant APP_MANAGER_ROLE = 0xb6d92708f3d4817afc106147d969e229ced5c46e65e0a5002a0d391287762bd0;
string private constant ERROR_APP_NOT_CONTRACT = "KERNEL_APP_NOT_CONTRACT";
string private constant ERROR_INVALID_APP_CHANGE = "KERNEL_INVALID_APP_CHANGE";
string private constant ERROR_AUTH_FAILED = "KERNEL_AUTH_FAILED";
/**
* @dev Constructor that allows the deployer to choose if the base instance should be petrified immediately.
* @param _shouldPetrify Immediately petrify this instance so that it can never be initialized
*/
constructor(bool _shouldPetrify) public {
}
/**
* @dev Initialize can only be called once. It saves the block number in which it was initialized.
* @notice Initialize this kernel instance along with its ACL and set `_permissionsCreator` as the entity that can create other permissions
* @param _baseAcl Address of base ACL app
* @param _permissionsCreator Entity that will be given permission over createPermission
*/
function initialize(IACL _baseAcl, address _permissionsCreator) public onlyInit {
}
/**
* @dev Create a new instance of an app linked to this kernel
* @notice Create a new upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`
* @param _appId Identifier for app
* @param _appBase Address of the app's base implementation
* @return AppProxy instance
*/
function newAppInstance(bytes32 _appId, address _appBase)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId))
returns (ERCProxy appProxy)
{
}
/**
* @dev Create a new instance of an app linked to this kernel and set its base
* implementation if it was not already set
* @notice Create a new upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`. `_setDefault ? 'Also sets it as the default app instance.':''`
* @param _appId Identifier for app
* @param _appBase Address of the app's base implementation
* @param _initializePayload Payload for call made by the proxy during its construction to initialize
* @param _setDefault Whether the app proxy app is the default one.
* Useful when the Kernel needs to know of an instance of a particular app,
* like Vault for escape hatch mechanism.
* @return AppProxy instance
*/
function newAppInstance(bytes32 _appId, address _appBase, bytes _initializePayload, bool _setDefault)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId))
returns (ERCProxy appProxy)
{
}
/**
* @dev Create a new pinned instance of an app linked to this kernel
* @notice Create a new non-upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`.
* @param _appId Identifier for app
* @param _appBase Address of the app's base implementation
* @return AppProxy instance
*/
function newPinnedAppInstance(bytes32 _appId, address _appBase)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId))
returns (ERCProxy appProxy)
{
}
/**
* @dev Create a new pinned instance of an app linked to this kernel and set
* its base implementation if it was not already set
* @notice Create a new non-upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`. `_setDefault ? 'Also sets it as the default app instance.':''`
* @param _appId Identifier for app
* @param _appBase Address of the app's base implementation
* @param _initializePayload Payload for call made by the proxy during its construction to initialize
* @param _setDefault Whether the app proxy app is the default one.
* Useful when the Kernel needs to know of an instance of a particular app,
* like Vault for escape hatch mechanism.
* @return AppProxy instance
*/
function newPinnedAppInstance(bytes32 _appId, address _appBase, bytes _initializePayload, bool _setDefault)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId))
returns (ERCProxy appProxy)
{
}
/**
* @dev Set the resolving address of an app instance or base implementation
* @notice Set the resolving address of `_appId` in namespace `_namespace` to `_app`
* @param _namespace App namespace to use
* @param _appId Identifier for app
* @param _app Address of the app instance or base implementation
* @return ID of app
*/
function setApp(bytes32 _namespace, bytes32 _appId, address _app)
public
auth(APP_MANAGER_ROLE, arr(_namespace, _appId))
{
}
/**
* @dev Set the default vault id for the escape hatch mechanism
* @param _recoveryVaultAppId Identifier of the recovery vault app
*/
function setRecoveryVaultAppId(bytes32 _recoveryVaultAppId)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_ADDR_NAMESPACE, _recoveryVaultAppId))
{
}
// External access to default app id and namespace constants to mimic default getters for constants
/* solium-disable function-order, mixedcase */
function CORE_NAMESPACE() external pure returns (bytes32) { }
function APP_BASES_NAMESPACE() external pure returns (bytes32) { }
function APP_ADDR_NAMESPACE() external pure returns (bytes32) { }
function KERNEL_APP_ID() external pure returns (bytes32) { }
function DEFAULT_ACL_APP_ID() external pure returns (bytes32) { }
/* solium-enable function-order, mixedcase */
/**
* @dev Get the address of an app instance or base implementation
* @param _namespace App namespace to use
* @param _appId Identifier for app
* @return Address of the app
*/
function getApp(bytes32 _namespace, bytes32 _appId) public view returns (address) {
}
/**
* @dev Get the address of the recovery Vault instance (to recover funds)
* @return Address of the Vault
*/
function getRecoveryVault() public view returns (address) {
}
/**
* @dev Get the installed ACL app
* @return ACL app
*/
function acl() public view returns (IACL) {
}
/**
* @dev Function called by apps to check ACL on kernel or to check permission status
* @param _who Sender of the original call
* @param _where Address of the app
* @param _what Identifier for a group of actions in app
* @param _how Extra data for ACL auth
* @return Boolean indicating whether the ACL allows the role or not.
* Always returns false if the kernel hasn't been initialized yet.
*/
function hasPermission(address _who, address _where, bytes32 _what, bytes _how) public view returns (bool) {
}
function _setApp(bytes32 _namespace, bytes32 _appId, address _app) internal {
require(<FILL_ME>)
apps[_namespace][_appId] = _app;
emit SetApp(_namespace, _appId, _app);
}
function _setAppIfNew(bytes32 _namespace, bytes32 _appId, address _app) internal {
}
modifier auth(bytes32 _role, uint256[] memory _params) {
}
}
| isContract(_app),ERROR_APP_NOT_CONTRACT | 1,038 | isContract(_app) |
ERROR_AUTH_FAILED | pragma solidity 0.4.24;
// solium-disable-next-line max-len
contract Kernel is IKernel, KernelStorage, KernelAppIds, KernelNamespaceConstants, Petrifiable, IsContract, VaultRecoverable, AppProxyFactory, ACLSyntaxSugar {
/* Hardcoded constants to save gas
bytes32 public constant APP_MANAGER_ROLE = keccak256("APP_MANAGER_ROLE");
*/
bytes32 public constant APP_MANAGER_ROLE = 0xb6d92708f3d4817afc106147d969e229ced5c46e65e0a5002a0d391287762bd0;
string private constant ERROR_APP_NOT_CONTRACT = "KERNEL_APP_NOT_CONTRACT";
string private constant ERROR_INVALID_APP_CHANGE = "KERNEL_INVALID_APP_CHANGE";
string private constant ERROR_AUTH_FAILED = "KERNEL_AUTH_FAILED";
/**
* @dev Constructor that allows the deployer to choose if the base instance should be petrified immediately.
* @param _shouldPetrify Immediately petrify this instance so that it can never be initialized
*/
constructor(bool _shouldPetrify) public {
}
/**
* @dev Initialize can only be called once. It saves the block number in which it was initialized.
* @notice Initialize this kernel instance along with its ACL and set `_permissionsCreator` as the entity that can create other permissions
* @param _baseAcl Address of base ACL app
* @param _permissionsCreator Entity that will be given permission over createPermission
*/
function initialize(IACL _baseAcl, address _permissionsCreator) public onlyInit {
}
/**
* @dev Create a new instance of an app linked to this kernel
* @notice Create a new upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`
* @param _appId Identifier for app
* @param _appBase Address of the app's base implementation
* @return AppProxy instance
*/
function newAppInstance(bytes32 _appId, address _appBase)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId))
returns (ERCProxy appProxy)
{
}
/**
* @dev Create a new instance of an app linked to this kernel and set its base
* implementation if it was not already set
* @notice Create a new upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`. `_setDefault ? 'Also sets it as the default app instance.':''`
* @param _appId Identifier for app
* @param _appBase Address of the app's base implementation
* @param _initializePayload Payload for call made by the proxy during its construction to initialize
* @param _setDefault Whether the app proxy app is the default one.
* Useful when the Kernel needs to know of an instance of a particular app,
* like Vault for escape hatch mechanism.
* @return AppProxy instance
*/
function newAppInstance(bytes32 _appId, address _appBase, bytes _initializePayload, bool _setDefault)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId))
returns (ERCProxy appProxy)
{
}
/**
* @dev Create a new pinned instance of an app linked to this kernel
* @notice Create a new non-upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`.
* @param _appId Identifier for app
* @param _appBase Address of the app's base implementation
* @return AppProxy instance
*/
function newPinnedAppInstance(bytes32 _appId, address _appBase)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId))
returns (ERCProxy appProxy)
{
}
/**
* @dev Create a new pinned instance of an app linked to this kernel and set
* its base implementation if it was not already set
* @notice Create a new non-upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`. `_setDefault ? 'Also sets it as the default app instance.':''`
* @param _appId Identifier for app
* @param _appBase Address of the app's base implementation
* @param _initializePayload Payload for call made by the proxy during its construction to initialize
* @param _setDefault Whether the app proxy app is the default one.
* Useful when the Kernel needs to know of an instance of a particular app,
* like Vault for escape hatch mechanism.
* @return AppProxy instance
*/
function newPinnedAppInstance(bytes32 _appId, address _appBase, bytes _initializePayload, bool _setDefault)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId))
returns (ERCProxy appProxy)
{
}
/**
* @dev Set the resolving address of an app instance or base implementation
* @notice Set the resolving address of `_appId` in namespace `_namespace` to `_app`
* @param _namespace App namespace to use
* @param _appId Identifier for app
* @param _app Address of the app instance or base implementation
* @return ID of app
*/
function setApp(bytes32 _namespace, bytes32 _appId, address _app)
public
auth(APP_MANAGER_ROLE, arr(_namespace, _appId))
{
}
/**
* @dev Set the default vault id for the escape hatch mechanism
* @param _recoveryVaultAppId Identifier of the recovery vault app
*/
function setRecoveryVaultAppId(bytes32 _recoveryVaultAppId)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_ADDR_NAMESPACE, _recoveryVaultAppId))
{
}
// External access to default app id and namespace constants to mimic default getters for constants
/* solium-disable function-order, mixedcase */
function CORE_NAMESPACE() external pure returns (bytes32) { }
function APP_BASES_NAMESPACE() external pure returns (bytes32) { }
function APP_ADDR_NAMESPACE() external pure returns (bytes32) { }
function KERNEL_APP_ID() external pure returns (bytes32) { }
function DEFAULT_ACL_APP_ID() external pure returns (bytes32) { }
/* solium-enable function-order, mixedcase */
/**
* @dev Get the address of an app instance or base implementation
* @param _namespace App namespace to use
* @param _appId Identifier for app
* @return Address of the app
*/
function getApp(bytes32 _namespace, bytes32 _appId) public view returns (address) {
}
/**
* @dev Get the address of the recovery Vault instance (to recover funds)
* @return Address of the Vault
*/
function getRecoveryVault() public view returns (address) {
}
/**
* @dev Get the installed ACL app
* @return ACL app
*/
function acl() public view returns (IACL) {
}
/**
* @dev Function called by apps to check ACL on kernel or to check permission status
* @param _who Sender of the original call
* @param _where Address of the app
* @param _what Identifier for a group of actions in app
* @param _how Extra data for ACL auth
* @return Boolean indicating whether the ACL allows the role or not.
* Always returns false if the kernel hasn't been initialized yet.
*/
function hasPermission(address _who, address _where, bytes32 _what, bytes _how) public view returns (bool) {
}
function _setApp(bytes32 _namespace, bytes32 _appId, address _app) internal {
}
function _setAppIfNew(bytes32 _namespace, bytes32 _appId, address _app) internal {
}
modifier auth(bytes32 _role, uint256[] memory _params) {
require(<FILL_ME>)
_;
}
}
| hasPermission(msg.sender,address(this),_role,ConversionHelpers.dangerouslyCastUintArrayToBytes(_params)),ERROR_AUTH_FAILED | 1,038 | hasPermission(msg.sender,address(this),_role,ConversionHelpers.dangerouslyCastUintArrayToBytes(_params)) |
"burning finished" | contract NokuCustomToken is Ownable {
event LogBurnFinished();
event LogPricingPlanChanged(address indexed caller, address indexed pricingPlan);
// The pricing plan determining the fee to be paid in NOKU tokens by customers for using Noku services
NokuPricingPlan public pricingPlan;
// The entity acting as Custom Token service provider i.e. Noku
address public serviceProvider;
// Flag indicating if Custom Token burning has been permanently finished or not.
bool public burningFinished;
/**
* @dev Modifier to make a function callable only by service provider i.e. Noku.
*/
modifier onlyServiceProvider() {
}
modifier canBurn() {
require(<FILL_ME>)
_;
}
constructor(address _pricingPlan, address _serviceProvider) internal {
}
/**
* @dev Presence of this function indicates the contract is a Custom Token.
*/
function isCustomToken() public pure returns(bool isCustom) {
}
/**
* @dev Stop burning new tokens.
* @return true if the operation was successful.
*/
function finishBurning() public onlyOwner canBurn returns(bool finished) {
}
/**
* @dev Change the pricing plan of service fee to be paid in NOKU tokens.
* @param _pricingPlan The pricing plan of NOKU token to be paid, zero means flat subscription.
*/
function setPricingPlan(address _pricingPlan) public onlyServiceProvider {
}
}
| !burningFinished,"burning finished" | 1,094 | !burningFinished |
null | /**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
require(<FILL_ME>)
}
function safeTransferFrom(
ERC20 token,
address from,
address to,
uint256 value
)
internal
{
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
}
}
| token.transfer(to,value) | 1,096 | token.transfer(to,value) |
null | /**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
}
function safeTransferFrom(
ERC20 token,
address from,
address to,
uint256 value
)
internal
{
require(<FILL_ME>)
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
}
}
| token.transferFrom(from,to,value) | 1,096 | token.transferFrom(from,to,value) |
null | /**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
}
function safeTransferFrom(
ERC20 token,
address from,
address to,
uint256 value
)
internal
{
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
require(<FILL_ME>)
}
}
| token.approve(spender,value) | 1,096 | token.approve(spender,value) |
null | /**
*Submitted for verification at Etherscan.io on 2022-03-04
*/
/**
*Submitted for verification at Etherscan.io on 2022-02-19
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.6.2;
interface ERC20 {
function balanceOf(address _owner) external view returns (uint256 balance);
function approve(address _spender, uint256 _value) external returns (bool success);
function transfer(address dst, uint wad) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) external view returns (uint256 remaining);
function decimals() external view returns (uint8 decimals);
}
contract sunClaim {
mapping(address => bool) isOwner;
mapping(address => uint) pubAllo;
mapping(address => uint) privAllo;
mapping(address => bool) hasClaimed_pub1;
mapping(address => bool) hasClaimed_pub2;
mapping(address => bool) hasClaimed_priv1;
mapping(address => bool) hasClaimed_priv2;
mapping(address => bool) hasClaimed_priv3;
address suntoken = 0xB3d8D8D659d4dc89699826D46585ac6cB3bEA05A;//mainnet: 0xB3d8D8D659d4dc89699826D46585ac6cB3bEA05A;
ERC20 TOKEN = ERC20(suntoken);
uint claim2_timestamp = 1650024000;
uint claim3_timestamp = 1652616000;
constructor() {
}
modifier owner {
require(<FILL_ME>) _;
}
function publicClaim1(address user) public{
}
function publicClaim2(address user) public{
}
function privateClaim1(address user) public{
}
function privateClaim2(address user) public{
}
function privateClaim3(address user) public{
}
function withdrawETH() public owner{
}
function withdrawTokens(address token) public owner{
}
function setTOKEN(address token) public owner{
}
function wipe(address user) public owner{
}
receive() external payable {}
fallback() external payable {}
}
| isOwner[msg.sender]==true | 1,117 | isOwner[msg.sender]==true |
null | /**
*Submitted for verification at Etherscan.io on 2022-03-04
*/
/**
*Submitted for verification at Etherscan.io on 2022-02-19
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.6.2;
interface ERC20 {
function balanceOf(address _owner) external view returns (uint256 balance);
function approve(address _spender, uint256 _value) external returns (bool success);
function transfer(address dst, uint wad) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) external view returns (uint256 remaining);
function decimals() external view returns (uint8 decimals);
}
contract sunClaim {
mapping(address => bool) isOwner;
mapping(address => uint) pubAllo;
mapping(address => uint) privAllo;
mapping(address => bool) hasClaimed_pub1;
mapping(address => bool) hasClaimed_pub2;
mapping(address => bool) hasClaimed_priv1;
mapping(address => bool) hasClaimed_priv2;
mapping(address => bool) hasClaimed_priv3;
address suntoken = 0xB3d8D8D659d4dc89699826D46585ac6cB3bEA05A;//mainnet: 0xB3d8D8D659d4dc89699826D46585ac6cB3bEA05A;
ERC20 TOKEN = ERC20(suntoken);
uint claim2_timestamp = 1650024000;
uint claim3_timestamp = 1652616000;
constructor() {
}
modifier owner {
}
function publicClaim1(address user) public{
require(<FILL_ME>)
uint amount = pubAllo[user] * 10**6;
TOKEN.approve(address(this),amount);
TOKEN.approve(msg.sender,amount);
TOKEN.transferFrom(address(this),user,amount);
hasClaimed_pub1[user] = true;
}
function publicClaim2(address user) public{
}
function privateClaim1(address user) public{
}
function privateClaim2(address user) public{
}
function privateClaim3(address user) public{
}
function withdrawETH() public owner{
}
function withdrawTokens(address token) public owner{
}
function setTOKEN(address token) public owner{
}
function wipe(address user) public owner{
}
receive() external payable {}
fallback() external payable {}
}
| hasClaimed_pub1[user]==false | 1,117 | hasClaimed_pub1[user]==false |
null | /**
*Submitted for verification at Etherscan.io on 2022-03-04
*/
/**
*Submitted for verification at Etherscan.io on 2022-02-19
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.6.2;
interface ERC20 {
function balanceOf(address _owner) external view returns (uint256 balance);
function approve(address _spender, uint256 _value) external returns (bool success);
function transfer(address dst, uint wad) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) external view returns (uint256 remaining);
function decimals() external view returns (uint8 decimals);
}
contract sunClaim {
mapping(address => bool) isOwner;
mapping(address => uint) pubAllo;
mapping(address => uint) privAllo;
mapping(address => bool) hasClaimed_pub1;
mapping(address => bool) hasClaimed_pub2;
mapping(address => bool) hasClaimed_priv1;
mapping(address => bool) hasClaimed_priv2;
mapping(address => bool) hasClaimed_priv3;
address suntoken = 0xB3d8D8D659d4dc89699826D46585ac6cB3bEA05A;//mainnet: 0xB3d8D8D659d4dc89699826D46585ac6cB3bEA05A;
ERC20 TOKEN = ERC20(suntoken);
uint claim2_timestamp = 1650024000;
uint claim3_timestamp = 1652616000;
constructor() {
}
modifier owner {
}
function publicClaim1(address user) public{
}
function publicClaim2(address user) public{
require(<FILL_ME>)
require(block.timestamp > claim2_timestamp);
uint amount = pubAllo[user] * 10**6;
TOKEN.approve(address(this),amount);
TOKEN.approve(msg.sender,amount);
TOKEN.transferFrom(address(this),user,amount);
hasClaimed_pub2[user] = true;
}
function privateClaim1(address user) public{
}
function privateClaim2(address user) public{
}
function privateClaim3(address user) public{
}
function withdrawETH() public owner{
}
function withdrawTokens(address token) public owner{
}
function setTOKEN(address token) public owner{
}
function wipe(address user) public owner{
}
receive() external payable {}
fallback() external payable {}
}
| hasClaimed_pub2[user]==false | 1,117 | hasClaimed_pub2[user]==false |
null | /**
*Submitted for verification at Etherscan.io on 2022-03-04
*/
/**
*Submitted for verification at Etherscan.io on 2022-02-19
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.6.2;
interface ERC20 {
function balanceOf(address _owner) external view returns (uint256 balance);
function approve(address _spender, uint256 _value) external returns (bool success);
function transfer(address dst, uint wad) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) external view returns (uint256 remaining);
function decimals() external view returns (uint8 decimals);
}
contract sunClaim {
mapping(address => bool) isOwner;
mapping(address => uint) pubAllo;
mapping(address => uint) privAllo;
mapping(address => bool) hasClaimed_pub1;
mapping(address => bool) hasClaimed_pub2;
mapping(address => bool) hasClaimed_priv1;
mapping(address => bool) hasClaimed_priv2;
mapping(address => bool) hasClaimed_priv3;
address suntoken = 0xB3d8D8D659d4dc89699826D46585ac6cB3bEA05A;//mainnet: 0xB3d8D8D659d4dc89699826D46585ac6cB3bEA05A;
ERC20 TOKEN = ERC20(suntoken);
uint claim2_timestamp = 1650024000;
uint claim3_timestamp = 1652616000;
constructor() {
}
modifier owner {
}
function publicClaim1(address user) public{
}
function publicClaim2(address user) public{
}
function privateClaim1(address user) public{
require(<FILL_ME>)
uint amount = privAllo[user] * 10**6;
TOKEN.approve(address(this),amount);
TOKEN.approve(msg.sender,amount);
TOKEN.transferFrom(address(this),user,amount);
hasClaimed_priv1[user] = true;
}
function privateClaim2(address user) public{
}
function privateClaim3(address user) public{
}
function withdrawETH() public owner{
}
function withdrawTokens(address token) public owner{
}
function setTOKEN(address token) public owner{
}
function wipe(address user) public owner{
}
receive() external payable {}
fallback() external payable {}
}
| hasClaimed_priv1[user]==false | 1,117 | hasClaimed_priv1[user]==false |
null | /**
*Submitted for verification at Etherscan.io on 2022-03-04
*/
/**
*Submitted for verification at Etherscan.io on 2022-02-19
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.6.2;
interface ERC20 {
function balanceOf(address _owner) external view returns (uint256 balance);
function approve(address _spender, uint256 _value) external returns (bool success);
function transfer(address dst, uint wad) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) external view returns (uint256 remaining);
function decimals() external view returns (uint8 decimals);
}
contract sunClaim {
mapping(address => bool) isOwner;
mapping(address => uint) pubAllo;
mapping(address => uint) privAllo;
mapping(address => bool) hasClaimed_pub1;
mapping(address => bool) hasClaimed_pub2;
mapping(address => bool) hasClaimed_priv1;
mapping(address => bool) hasClaimed_priv2;
mapping(address => bool) hasClaimed_priv3;
address suntoken = 0xB3d8D8D659d4dc89699826D46585ac6cB3bEA05A;//mainnet: 0xB3d8D8D659d4dc89699826D46585ac6cB3bEA05A;
ERC20 TOKEN = ERC20(suntoken);
uint claim2_timestamp = 1650024000;
uint claim3_timestamp = 1652616000;
constructor() {
}
modifier owner {
}
function publicClaim1(address user) public{
}
function publicClaim2(address user) public{
}
function privateClaim1(address user) public{
}
function privateClaim2(address user) public{
require(block.timestamp > claim2_timestamp);
require(<FILL_ME>)
uint amount = privAllo[user] * 10**6;
TOKEN.approve(address(this),amount);
TOKEN.approve(msg.sender,amount);
TOKEN.transferFrom(address(this),user,amount);
hasClaimed_priv2[user] = true;
}
function privateClaim3(address user) public{
}
function withdrawETH() public owner{
}
function withdrawTokens(address token) public owner{
}
function setTOKEN(address token) public owner{
}
function wipe(address user) public owner{
}
receive() external payable {}
fallback() external payable {}
}
| hasClaimed_priv2[user]==false | 1,117 | hasClaimed_priv2[user]==false |
null | /**
*Submitted for verification at Etherscan.io on 2022-03-04
*/
/**
*Submitted for verification at Etherscan.io on 2022-02-19
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.6.2;
interface ERC20 {
function balanceOf(address _owner) external view returns (uint256 balance);
function approve(address _spender, uint256 _value) external returns (bool success);
function transfer(address dst, uint wad) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) external view returns (uint256 remaining);
function decimals() external view returns (uint8 decimals);
}
contract sunClaim {
mapping(address => bool) isOwner;
mapping(address => uint) pubAllo;
mapping(address => uint) privAllo;
mapping(address => bool) hasClaimed_pub1;
mapping(address => bool) hasClaimed_pub2;
mapping(address => bool) hasClaimed_priv1;
mapping(address => bool) hasClaimed_priv2;
mapping(address => bool) hasClaimed_priv3;
address suntoken = 0xB3d8D8D659d4dc89699826D46585ac6cB3bEA05A;//mainnet: 0xB3d8D8D659d4dc89699826D46585ac6cB3bEA05A;
ERC20 TOKEN = ERC20(suntoken);
uint claim2_timestamp = 1650024000;
uint claim3_timestamp = 1652616000;
constructor() {
}
modifier owner {
}
function publicClaim1(address user) public{
}
function publicClaim2(address user) public{
}
function privateClaim1(address user) public{
}
function privateClaim2(address user) public{
}
function privateClaim3(address user) public{
require(block.timestamp > claim3_timestamp);
require(<FILL_ME>)
uint amount = privAllo[user] * 10**6;
TOKEN.approve(address(this),amount);
TOKEN.approve(msg.sender,amount);
TOKEN.transferFrom(address(this),user,amount);
hasClaimed_priv3[user] = true;
}
function withdrawETH() public owner{
}
function withdrawTokens(address token) public owner{
}
function setTOKEN(address token) public owner{
}
function wipe(address user) public owner{
}
receive() external payable {}
fallback() external payable {}
}
| hasClaimed_priv3[user]==false | 1,117 | hasClaimed_priv3[user]==false |
"Only payment handlers are allowed to trigger payment events." | pragma solidity 0.5.16;
// import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
/**
* The PaymentMaster sits above the payment handler contracts.
* It deploys and keeps track of all the handlers.
* It can trigger events by child handlers when they receive ETH.
* It allows ERC20 tokens to be swept in bulk to the owner account.
*/
contract PaymentMaster {
using SafeERC20 for IERC20;
address public owner;
// payment handler logic contract address
address public handlerLogicAddress ;
// A list of handler addresses for retrieval
address[] public handlerList;
// A mapping of handler addresses for lookups
mapping(address => bool) public handlerMap;
// Events triggered for listeners
event HandlerCreated(address indexed _addr);
event EthPaymentReceived(address indexed _to, address indexed _from, uint256 _amount);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
bool initialized = false;
function initialize(address _owner, address _handlerLogicAddress) public {
}
/**
* Anyone can call the function to deploy a new payment handler.
* The new contract will be created, added to the list, and an event fired.
*/
function deployNewHandler() public {
}
/**
* Allows caller to determine how long the handler list is for convenience
*/
function getHandlerListLength() public view returns (uint) {
}
/**
* This function is called by handlers when they receive ETH payments.
*/
function firePaymentReceivedEvent(address to, address from, uint256 amount) public {
// Verify the call is coming from a handler
require(<FILL_ME>)
// Emit the event
emit EthPaymentReceived(to, from, amount);
}
/**
* Allows a caller to sweep multiple handlers in one transaction
*/
function multiHandlerSweep(address[] memory handlers, IERC20 tokenContract) public {
}
/**
* Safety function to allow sweep of ERC20s if accidentally sent to this contract
*/
function sweepTokens(IERC20 token) public {
}
function transferOwnership(address newOwner) public {
}
}
| handlerMap[msg.sender],"Only payment handlers are allowed to trigger payment events." | 1,132 | handlerMap[msg.sender] |
"Only payment handlers are valid sweep targets." | pragma solidity 0.5.16;
// import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
/**
* The PaymentMaster sits above the payment handler contracts.
* It deploys and keeps track of all the handlers.
* It can trigger events by child handlers when they receive ETH.
* It allows ERC20 tokens to be swept in bulk to the owner account.
*/
contract PaymentMaster {
using SafeERC20 for IERC20;
address public owner;
// payment handler logic contract address
address public handlerLogicAddress ;
// A list of handler addresses for retrieval
address[] public handlerList;
// A mapping of handler addresses for lookups
mapping(address => bool) public handlerMap;
// Events triggered for listeners
event HandlerCreated(address indexed _addr);
event EthPaymentReceived(address indexed _to, address indexed _from, uint256 _amount);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
bool initialized = false;
function initialize(address _owner, address _handlerLogicAddress) public {
}
/**
* Anyone can call the function to deploy a new payment handler.
* The new contract will be created, added to the list, and an event fired.
*/
function deployNewHandler() public {
}
/**
* Allows caller to determine how long the handler list is for convenience
*/
function getHandlerListLength() public view returns (uint) {
}
/**
* This function is called by handlers when they receive ETH payments.
*/
function firePaymentReceivedEvent(address to, address from, uint256 amount) public {
}
/**
* Allows a caller to sweep multiple handlers in one transaction
*/
function multiHandlerSweep(address[] memory handlers, IERC20 tokenContract) public {
for (uint i = 0; i < handlers.length; i++) {
// Whitelist calls to only handlers
require(<FILL_ME>)
// Trigger sweep
PaymentHandler(address(uint160(handlers[i]))).sweepTokens(tokenContract);
}
}
/**
* Safety function to allow sweep of ERC20s if accidentally sent to this contract
*/
function sweepTokens(IERC20 token) public {
}
function transferOwnership(address newOwner) public {
}
}
| handlerMap[handlers[i]],"Only payment handlers are valid sweep targets." | 1,132 | handlerMap[handlers[i]] |
null | pragma solidity ^0.4.23;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(<FILL_ME>)
_;
}
modifier hasMintPermission() {
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
hasMintPermission
canMint
public
returns (bool)
{
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
}
function _burn(address _who, uint256 _value) internal {
}
}
contract Afin is MintableToken, BurnableToken {
string public name = "Asian Fintech";
string public symbol = "Afin";
uint public decimals = 8;
uint public INITIAL_SUPPLY = 500000000 * (10 ** decimals);
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() public {
}
}
| !mintingFinished | 1,135 | !mintingFinished |
Errors.CT_CALLER_MUST_BE_MARGIN_POOL | // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;
import {IMarginPool} from './IMarginPool.sol';
import {ICreditDelegationToken} from './ICreditDelegationToken.sol';
import {IncentivizedERC20} from './IncentivizedERC20.sol';
import {Errors} from './Errors.sol';
/**
* @title DebtTokenBase
* @author Lever
*/
abstract contract DebtTokenBase is
IncentivizedERC20,
ICreditDelegationToken
{
address public immutable UNDERLYING_ASSET_ADDRESS;
IMarginPool public immutable POOL;
mapping(address => mapping(address => uint256)) internal _borrowAllowances;
/**
* @dev Only margin pool can call functions marked by this modifier
**/
modifier onlyMarginPool {
require(<FILL_ME>)
_;
}
/**
* @dev The metadata of the token will be set on the proxy, that the reason of
* passing "NULL" and 0 as metadata
*/
constructor(
address pool,
address underlyingAssetAddress,
string memory name,
string memory symbol,
uint8 decimals
) public IncentivizedERC20(name, symbol, decimals) {
}
/**
* @dev delegates borrowing power to a user on the specific debt token
* @param delegatee the address receiving the delegated borrowing power
* @param amount the maximum amount being delegated. Delegation will still
* respect the liquidation constraints (even if delegated, a delegatee cannot
* force a delegator HF to go below 1)
**/
function approveDelegation(address delegatee, uint256 amount) external override {
}
/**
* @dev returns the borrow allowance of the user
* @param fromUser The user to giving allowance
* @param toUser The user to give allowance to
* @return the current allowance of toUser
**/
function borrowAllowance(address fromUser, address toUser)
external
view
override
returns (uint256)
{
}
/**
* @dev Being non transferrable, the debt token does not implement any of the
* standard ERC20 functions for transfer and allowance.
**/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function allowance(address owner, address spender)
public
view
virtual
override
returns (uint256)
{
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
override
returns (bool)
{
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
override
returns (bool)
{
}
function _decreaseBorrowAllowance(
address delegator,
address delegatee,
uint256 amount
) internal {
}
}
| _msgSender()==address(POOL),Errors.CT_CALLER_MUST_BE_MARGIN_POOL | 1,200 | _msgSender()==address(POOL) |
'SafeERC20: approve from non-zero to non-zero allowance' | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import {IERC20} from './IERC20.sol';
import {SafeMath} from './SafeMath.sol';
import {Address} from './Address.sol';
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
require(<FILL_ME>)
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
| (value==0)||(token.allowance(address(this),spender)==0),'SafeERC20: approve from non-zero to non-zero allowance' | 1,230 | (value==0)||(token.allowance(address(this),spender)==0) |
'SafeERC20: call to non-contract' | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import {IERC20} from './IERC20.sol';
import {SafeMath} from './SafeMath.sol';
import {Address} from './Address.sol';
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(<FILL_ME>)
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, 'SafeERC20: low-level call failed');
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), 'SafeERC20: ERC20 operation did not succeed');
}
}
}
| address(token).isContract(),'SafeERC20: call to non-contract' | 1,230 | address(token).isContract() |
'SafeERC20: ERC20 operation did not succeed' | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import {IERC20} from './IERC20.sol';
import {SafeMath} from './SafeMath.sol';
import {Address} from './Address.sol';
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), 'SafeERC20: call to non-contract');
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, 'SafeERC20: low-level call failed');
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(<FILL_ME>)
}
}
}
| abi.decode(returndata,(bool)),'SafeERC20: ERC20 operation did not succeed' | 1,230 | abi.decode(returndata,(bool)) |
null | pragma solidity ^0.4.16;
/***
* yfiexchange.finance
*Token symboi: YFIE
* @title ERC20 interface
* @dev see
*/
contract owned {
address public owner;
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
}
/**
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(<FILL_ME>)
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
}
/**
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
}
}
/******************************************/
/* Change the name of the contract from Kahawanu to your own token name
*/
/******************************************/
contract YFIE is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
}
function freezeAccount(address target, bool freeze) onlyOwner public {
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
}
/// @notice Sell `amount` tokens to contract
/// @param amount amount of tokens to be sold
function sell(uint256 amount) public {
}
}
| balanceOf[_from]>=_value | 1,262 | balanceOf[_from]>=_value |
null | pragma solidity ^0.4.16;
/***
* yfiexchange.finance
*Token symboi: YFIE
* @title ERC20 interface
* @dev see
*/
contract owned {
address public owner;
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
}
/**
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(<FILL_ME>)
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
}
/**
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
}
}
/******************************************/
/* Change the name of the contract from Kahawanu to your own token name
*/
/******************************************/
contract YFIE is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
}
function freezeAccount(address target, bool freeze) onlyOwner public {
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
}
/// @notice Sell `amount` tokens to contract
/// @param amount amount of tokens to be sold
function sell(uint256 amount) public {
}
}
| balanceOf[_to]+_value>balanceOf[_to] | 1,262 | balanceOf[_to]+_value>balanceOf[_to] |
null | pragma solidity ^0.4.16;
/***
* yfiexchange.finance
*Token symboi: YFIE
* @title ERC20 interface
* @dev see
*/
contract owned {
address public owner;
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
}
/**
*/
function _transfer(address _from, address _to, uint _value) internal {
}
/**
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
}
/**
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(<FILL_ME>) // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
}
}
/******************************************/
/* Change the name of the contract from Kahawanu to your own token name
*/
/******************************************/
contract YFIE is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
}
function freezeAccount(address target, bool freeze) onlyOwner public {
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
}
/// @notice Sell `amount` tokens to contract
/// @param amount amount of tokens to be sold
function sell(uint256 amount) public {
}
}
| balanceOf[msg.sender]>=_value | 1,262 | balanceOf[msg.sender]>=_value |
null | pragma solidity ^0.4.16;
/***
* yfiexchange.finance
*Token symboi: YFIE
* @title ERC20 interface
* @dev see
*/
contract owned {
address public owner;
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
}
/**
*/
function _transfer(address _from, address _to, uint _value) internal {
}
/**
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
}
/**
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
}
}
/******************************************/
/* Change the name of the contract from Kahawanu to your own token name
*/
/******************************************/
contract YFIE is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require(<FILL_ME>) // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
function freezeAccount(address target, bool freeze) onlyOwner public {
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
}
/// @notice Sell `amount` tokens to contract
/// @param amount amount of tokens to be sold
function sell(uint256 amount) public {
}
}
| balanceOf[_to]+_value>=balanceOf[_to] | 1,262 | balanceOf[_to]+_value>=balanceOf[_to] |
null | pragma solidity ^0.4.16;
/***
* yfiexchange.finance
*Token symboi: YFIE
* @title ERC20 interface
* @dev see
*/
contract owned {
address public owner;
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
}
/**
*/
function _transfer(address _from, address _to, uint _value) internal {
}
/**
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
}
/**
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
}
}
/******************************************/
/* Change the name of the contract from Kahawanu to your own token name
*/
/******************************************/
contract YFIE is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
require(<FILL_ME>) // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
function freezeAccount(address target, bool freeze) onlyOwner public {
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
}
/// @notice Sell `amount` tokens to contract
/// @param amount amount of tokens to be sold
function sell(uint256 amount) public {
}
}
| !frozenAccount[_from] | 1,262 | !frozenAccount[_from] |
null | pragma solidity ^0.4.16;
/***
* yfiexchange.finance
*Token symboi: YFIE
* @title ERC20 interface
* @dev see
*/
contract owned {
address public owner;
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
}
/**
*/
function _transfer(address _from, address _to, uint _value) internal {
}
/**
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
}
/**
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
}
}
/******************************************/
/* Change the name of the contract from Kahawanu to your own token name
*/
/******************************************/
contract YFIE is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(<FILL_ME>) // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
function freezeAccount(address target, bool freeze) onlyOwner public {
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
}
/// @notice Sell `amount` tokens to contract
/// @param amount amount of tokens to be sold
function sell(uint256 amount) public {
}
}
| !frozenAccount[_to] | 1,262 | !frozenAccount[_to] |
"ERC721Metadata: URI query for nonexistent token" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./IERC721Metadata.sol";
import "./Address.sol";
import "./Context.sol";
import "./Strings.sol";
import "./ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(<FILL_ME>)
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString(),".json")) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
| _exists(tokenId),"ERC721Metadata: URI query for nonexistent token" | 1,320 | _exists(tokenId) |
"ERC721: approve caller is not owner nor approved for all" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./IERC721Metadata.sol";
import "./Address.sol";
import "./Context.sol";
import "./Strings.sol";
import "./ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(<FILL_ME>)
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
| _msgSender()==owner||isApprovedForAll(owner,_msgSender()),"ERC721: approve caller is not owner nor approved for all" | 1,320 | _msgSender()==owner||isApprovedForAll(owner,_msgSender()) |
"ERC721: transfer caller is not owner nor approved" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./IERC721Metadata.sol";
import "./Address.sol";
import "./Context.sol";
import "./Strings.sol";
import "./ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(<FILL_ME>)
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
| _isApprovedOrOwner(_msgSender(),tokenId),"ERC721: transfer caller is not owner nor approved" | 1,320 | _isApprovedOrOwner(_msgSender(),tokenId) |
"ERC721: transfer to non ERC721Receiver implementer" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./IERC721Metadata.sol";
import "./Address.sol";
import "./Context.sol";
import "./Strings.sol";
import "./ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(<FILL_ME>)
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
| _checkOnERC721Received(from,to,tokenId,_data),"ERC721: transfer to non ERC721Receiver implementer" | 1,320 | _checkOnERC721Received(from,to,tokenId,_data) |
"ERC721: transfer to non ERC721Receiver implementer" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./IERC721Metadata.sol";
import "./Address.sol";
import "./Context.sol";
import "./Strings.sol";
import "./ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(<FILL_ME>)
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
| _checkOnERC721Received(address(0),to,tokenId,_data),"ERC721: transfer to non ERC721Receiver implementer" | 1,320 | _checkOnERC721Received(address(0),to,tokenId,_data) |
"ERC721: token already minted" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./IERC721Metadata.sol";
import "./Address.sol";
import "./Context.sol";
import "./Strings.sol";
import "./ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(<FILL_ME>)
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
| !_exists(tokenId),"ERC721: token already minted" | 1,320 | !_exists(tokenId) |
"ERC721: transfer of token that is not own" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./IERC721Metadata.sol";
import "./Address.sol";
import "./Context.sol";
import "./Strings.sol";
import "./ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(<FILL_ME>)
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
| ERC721.ownerOf(tokenId)==from,"ERC721: transfer of token that is not own" | 1,320 | ERC721.ownerOf(tokenId)==from |
"Access restricted to modules" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "../governance/IGovernance.sol";
import "../initializable/Ownable.sol";
import "../initializable/ERC20.sol";
import "../initializable/ERC1363.sol";
contract ShardedWallet is Ownable, ERC20, ERC1363Approve
{
// bytes32 public constant ALLOW_GOVERNANCE_UPGRADE = bytes32(uint256(keccak256("ALLOW_GOVERNANCE_UPGRADE")) - 1);
bytes32 public constant ALLOW_GOVERNANCE_UPGRADE = 0xedde61aea0459bc05d70dd3441790ccfb6c17980a380201b00eca6f9ef50452a;
IGovernance public governance;
address public artistWallet;
event Received(address indexed sender, uint256 value, bytes data);
event Execute(address indexed to, uint256 value, bytes data);
event ModuleExecute(address indexed module, address indexed to, uint256 value, bytes data);
event GovernanceUpdated(address indexed oldGovernance, address indexed newGovernance);
event ArtistUpdated(address indexed oldArtist, address indexed newArtist);
modifier onlyModule()
{
require(<FILL_ME>)
_;
}
/*************************************************************************
* Contructor and fallbacks *
*************************************************************************/
constructor()
{
}
receive()
external payable
{
}
fallback()
external payable
{
}
/*************************************************************************
* Initialization *
*************************************************************************/
function initialize(
address governance_,
address minter_,
string calldata name_,
string calldata symbol_,
address artistWallet_
)
external
{
}
function _isModule(address module)
internal view returns (bool)
{
}
/*************************************************************************
* Owner interactions *
*************************************************************************/
function execute(address to, uint256 value, bytes calldata data)
external onlyOwner()
{
}
function retrieve(address newOwner)
external
{
}
/*************************************************************************
* Module interactions *
*************************************************************************/
function moduleExecute(address to, uint256 value, bytes calldata data)
external onlyModule()
{
}
function moduleMint(address to, uint256 value)
external onlyModule()
{
}
function moduleBurn(address from, uint256 value)
external onlyModule()
{
}
function moduleTransfer(address from, address to, uint256 value)
external onlyModule()
{
}
function moduleTransferOwnership(address to)
external onlyModule()
{
}
function updateGovernance(address newGovernance)
external onlyModule()
{
}
function updateArtistWallet(address newArtistWallet)
external onlyModule()
{
}
}
| _isModule(msg.sender),"Access restricted to modules" | 1,327 | _isModule(msg.sender) |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "../governance/IGovernance.sol";
import "../initializable/Ownable.sol";
import "../initializable/ERC20.sol";
import "../initializable/ERC1363.sol";
contract ShardedWallet is Ownable, ERC20, ERC1363Approve
{
// bytes32 public constant ALLOW_GOVERNANCE_UPGRADE = bytes32(uint256(keccak256("ALLOW_GOVERNANCE_UPGRADE")) - 1);
bytes32 public constant ALLOW_GOVERNANCE_UPGRADE = 0xedde61aea0459bc05d70dd3441790ccfb6c17980a380201b00eca6f9ef50452a;
IGovernance public governance;
address public artistWallet;
event Received(address indexed sender, uint256 value, bytes data);
event Execute(address indexed to, uint256 value, bytes data);
event ModuleExecute(address indexed module, address indexed to, uint256 value, bytes data);
event GovernanceUpdated(address indexed oldGovernance, address indexed newGovernance);
event ArtistUpdated(address indexed oldArtist, address indexed newArtist);
modifier onlyModule()
{
}
/*************************************************************************
* Contructor and fallbacks *
*************************************************************************/
constructor()
{
}
receive()
external payable
{
}
fallback()
external payable
{
}
/*************************************************************************
* Initialization *
*************************************************************************/
function initialize(
address governance_,
address minter_,
string calldata name_,
string calldata symbol_,
address artistWallet_
)
external
{
require(<FILL_ME>)
governance = IGovernance(governance_);
Ownable._setOwner(minter_);
ERC20._initialize(name_, symbol_);
artistWallet = artistWallet_;
emit GovernanceUpdated(address(0), governance_);
}
function _isModule(address module)
internal view returns (bool)
{
}
/*************************************************************************
* Owner interactions *
*************************************************************************/
function execute(address to, uint256 value, bytes calldata data)
external onlyOwner()
{
}
function retrieve(address newOwner)
external
{
}
/*************************************************************************
* Module interactions *
*************************************************************************/
function moduleExecute(address to, uint256 value, bytes calldata data)
external onlyModule()
{
}
function moduleMint(address to, uint256 value)
external onlyModule()
{
}
function moduleBurn(address from, uint256 value)
external onlyModule()
{
}
function moduleTransfer(address from, address to, uint256 value)
external onlyModule()
{
}
function moduleTransferOwnership(address to)
external onlyModule()
{
}
function updateGovernance(address newGovernance)
external onlyModule()
{
}
function updateArtistWallet(address newArtistWallet)
external onlyModule()
{
}
}
| address(governance)==address(0) | 1,327 | address(governance)==address(0) |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "../governance/IGovernance.sol";
import "../initializable/Ownable.sol";
import "../initializable/ERC20.sol";
import "../initializable/ERC1363.sol";
contract ShardedWallet is Ownable, ERC20, ERC1363Approve
{
// bytes32 public constant ALLOW_GOVERNANCE_UPGRADE = bytes32(uint256(keccak256("ALLOW_GOVERNANCE_UPGRADE")) - 1);
bytes32 public constant ALLOW_GOVERNANCE_UPGRADE = 0xedde61aea0459bc05d70dd3441790ccfb6c17980a380201b00eca6f9ef50452a;
IGovernance public governance;
address public artistWallet;
event Received(address indexed sender, uint256 value, bytes data);
event Execute(address indexed to, uint256 value, bytes data);
event ModuleExecute(address indexed module, address indexed to, uint256 value, bytes data);
event GovernanceUpdated(address indexed oldGovernance, address indexed newGovernance);
event ArtistUpdated(address indexed oldArtist, address indexed newArtist);
modifier onlyModule()
{
}
/*************************************************************************
* Contructor and fallbacks *
*************************************************************************/
constructor()
{
}
receive()
external payable
{
}
fallback()
external payable
{
}
/*************************************************************************
* Initialization *
*************************************************************************/
function initialize(
address governance_,
address minter_,
string calldata name_,
string calldata symbol_,
address artistWallet_
)
external
{
}
function _isModule(address module)
internal view returns (bool)
{
}
/*************************************************************************
* Owner interactions *
*************************************************************************/
function execute(address to, uint256 value, bytes calldata data)
external onlyOwner()
{
}
function retrieve(address newOwner)
external
{
}
/*************************************************************************
* Module interactions *
*************************************************************************/
function moduleExecute(address to, uint256 value, bytes calldata data)
external onlyModule()
{
}
function moduleMint(address to, uint256 value)
external onlyModule()
{
}
function moduleBurn(address from, uint256 value)
external onlyModule()
{
}
function moduleTransfer(address from, address to, uint256 value)
external onlyModule()
{
}
function moduleTransferOwnership(address to)
external onlyModule()
{
}
function updateGovernance(address newGovernance)
external onlyModule()
{
emit GovernanceUpdated(address(governance), newGovernance);
require(<FILL_ME>)
require(Address.isContract(newGovernance));
governance = IGovernance(newGovernance);
}
function updateArtistWallet(address newArtistWallet)
external onlyModule()
{
}
}
| governance.getConfig(address(this),ALLOW_GOVERNANCE_UPGRADE)>0 | 1,327 | governance.getConfig(address(this),ALLOW_GOVERNANCE_UPGRADE)>0 |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "../governance/IGovernance.sol";
import "../initializable/Ownable.sol";
import "../initializable/ERC20.sol";
import "../initializable/ERC1363.sol";
contract ShardedWallet is Ownable, ERC20, ERC1363Approve
{
// bytes32 public constant ALLOW_GOVERNANCE_UPGRADE = bytes32(uint256(keccak256("ALLOW_GOVERNANCE_UPGRADE")) - 1);
bytes32 public constant ALLOW_GOVERNANCE_UPGRADE = 0xedde61aea0459bc05d70dd3441790ccfb6c17980a380201b00eca6f9ef50452a;
IGovernance public governance;
address public artistWallet;
event Received(address indexed sender, uint256 value, bytes data);
event Execute(address indexed to, uint256 value, bytes data);
event ModuleExecute(address indexed module, address indexed to, uint256 value, bytes data);
event GovernanceUpdated(address indexed oldGovernance, address indexed newGovernance);
event ArtistUpdated(address indexed oldArtist, address indexed newArtist);
modifier onlyModule()
{
}
/*************************************************************************
* Contructor and fallbacks *
*************************************************************************/
constructor()
{
}
receive()
external payable
{
}
fallback()
external payable
{
}
/*************************************************************************
* Initialization *
*************************************************************************/
function initialize(
address governance_,
address minter_,
string calldata name_,
string calldata symbol_,
address artistWallet_
)
external
{
}
function _isModule(address module)
internal view returns (bool)
{
}
/*************************************************************************
* Owner interactions *
*************************************************************************/
function execute(address to, uint256 value, bytes calldata data)
external onlyOwner()
{
}
function retrieve(address newOwner)
external
{
}
/*************************************************************************
* Module interactions *
*************************************************************************/
function moduleExecute(address to, uint256 value, bytes calldata data)
external onlyModule()
{
}
function moduleMint(address to, uint256 value)
external onlyModule()
{
}
function moduleBurn(address from, uint256 value)
external onlyModule()
{
}
function moduleTransfer(address from, address to, uint256 value)
external onlyModule()
{
}
function moduleTransferOwnership(address to)
external onlyModule()
{
}
function updateGovernance(address newGovernance)
external onlyModule()
{
emit GovernanceUpdated(address(governance), newGovernance);
require(governance.getConfig(address(this), ALLOW_GOVERNANCE_UPGRADE) > 0);
require(<FILL_ME>)
governance = IGovernance(newGovernance);
}
function updateArtistWallet(address newArtistWallet)
external onlyModule()
{
}
}
| Address.isContract(newGovernance) | 1,327 | Address.isContract(newGovernance) |
"ERC1155: batch balance query for the zero address" | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
*
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using SafeMath for uint256;
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substition, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/*
* bytes4(keccak256('balanceOf(address,uint256)')) == 0x00fdd58e
* bytes4(keccak256('balanceOfBatch(address[],uint256[])')) == 0x4e1273f4
* bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
* bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
* bytes4(keccak256('safeTransferFrom(address,address,uint256,uint256,bytes)')) == 0xf242432a
* bytes4(keccak256('safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)')) == 0x2eb2c2d6
*
* => 0x00fdd58e ^ 0x4e1273f4 ^ 0xa22cb465 ^
* 0xe985e9c5 ^ 0xf242432a ^ 0x2eb2c2d6 == 0xd9b67a26
*/
bytes4 private constant _INTERFACE_ID_ERC1155 = 0xd9b67a26;
/*
* bytes4(keccak256('uri(uint256)')) == 0x0e89341c
*/
bytes4 private constant _INTERFACE_ID_ERC1155_METADATA_URI = 0x0e89341c;
/**
* @dev See {_setURI}.
*/
constructor(string memory uri) public {
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substituion mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) external view override returns (string memory) {
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id)
public
view
override
returns (uint256)
{
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
override
returns (uint256[] memory)
{
require(
accounts.length == ids.length,
"ERC1155: accounts and ids length mismatch"
);
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
require(<FILL_ME>)
batchBalances[i] = _balances[ids[i]][accounts[i]];
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved)
public
virtual
override
{
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator)
public
view
override
returns (bool)
{
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substituion mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `account`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(
address account,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
}
/**
* @dev Destroys `amount` tokens of token type `id` from `account`
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens of token type `id`.
*/
function _burn(
address account,
uint256 id,
uint256 amount
) internal virtual {
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address account,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
}
function _asSingletonArray(uint256 element)
private
pure
returns (uint256[] memory)
{
}
}
| accounts[i]!=address(0),"ERC1155: batch balance query for the zero address" | 1,390 | accounts[i]!=address(0) |
"ERC1155: setting approval status for self" | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
*
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using SafeMath for uint256;
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substition, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/*
* bytes4(keccak256('balanceOf(address,uint256)')) == 0x00fdd58e
* bytes4(keccak256('balanceOfBatch(address[],uint256[])')) == 0x4e1273f4
* bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
* bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
* bytes4(keccak256('safeTransferFrom(address,address,uint256,uint256,bytes)')) == 0xf242432a
* bytes4(keccak256('safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)')) == 0x2eb2c2d6
*
* => 0x00fdd58e ^ 0x4e1273f4 ^ 0xa22cb465 ^
* 0xe985e9c5 ^ 0xf242432a ^ 0x2eb2c2d6 == 0xd9b67a26
*/
bytes4 private constant _INTERFACE_ID_ERC1155 = 0xd9b67a26;
/*
* bytes4(keccak256('uri(uint256)')) == 0x0e89341c
*/
bytes4 private constant _INTERFACE_ID_ERC1155_METADATA_URI = 0x0e89341c;
/**
* @dev See {_setURI}.
*/
constructor(string memory uri) public {
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substituion mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) external view override returns (string memory) {
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id)
public
view
override
returns (uint256)
{
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
override
returns (uint256[] memory)
{
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved)
public
virtual
override
{
require(<FILL_ME>)
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator)
public
view
override
returns (bool)
{
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substituion mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `account`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(
address account,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
}
/**
* @dev Destroys `amount` tokens of token type `id` from `account`
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens of token type `id`.
*/
function _burn(
address account,
uint256 id,
uint256 amount
) internal virtual {
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address account,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
}
function _asSingletonArray(uint256 element)
private
pure
returns (uint256[] memory)
{
}
}
| _msgSender()!=operator,"ERC1155: setting approval status for self" | 1,390 | _msgSender()!=operator |
"Token: Total supply will exceed max total supply" | pragma solidity ^0.7.0;
contract testToken is ERC20, Ownable
{
using SafeMath for uint256;
uint256 public maxTotalSupply;
constructor(
string memory name,
string memory symbol,
uint256 _maxTotalSupply,
uint8 decimals
)
ERC20(name, symbol)
{
}
function mint(address to, uint256 amount) external onlyOwner
{
require(<FILL_ME>)
_mint(to, amount);
}
}
| totalSupply().add(amount)<maxTotalSupply,"Token: Total supply will exceed max total supply" | 1,419 | totalSupply().add(amount)<maxTotalSupply |
null | pragma solidity 0.4.24;
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* > Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an `Approval` event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/*
Copyright Ethfinex Inc 2018
Licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0
*/
contract WrapperLock is BasicToken, Ownable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public TRANSFER_PROXY_VEFX = 0xdcDb42C9a256690bd153A7B409751ADFC8Dd5851;
address public TRANSFER_PROXY_V2 = 0x95e6f48254609a6ee006f7d493c8e5fb97094cef;
mapping (address => bool) public isSigner;
string public name;
string public symbol;
uint public decimals;
address public originalToken;
mapping (address => uint256) public depositLock;
mapping (address => uint256) public balances;
function WrapperLock(address _originalToken, string _name, string _symbol, uint _decimals) Ownable() {
}
// @dev method only for testing, needs to be commented out when deploying
// function addProxy(address _addr) public {
// TRANSFER_PROXY_VEFX = _addr;
// }
function deposit(uint _value, uint _forTime) public returns (bool success) {
require(_forTime >= 1);
require(<FILL_ME>)
IERC20(originalToken).safeTransferFrom(msg.sender, address(this), _value);
balances[msg.sender] = balances[msg.sender].add(_value);
totalSupply_ = totalSupply_.add(_value);
depositLock[msg.sender] = now + _forTime * 1 hours;
return true;
}
function withdraw(
uint _value,
uint8 v,
bytes32 r,
bytes32 s,
uint signatureValidUntilBlock
)
public
returns
(bool success)
{
}
function withdrawBalanceDifference() public onlyOwner returns (bool success) {
}
function withdrawDifferentToken(address _differentToken) public onlyOwner returns (bool) {
}
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint _value) public {
}
function allowance(address _owner, address _spender) public constant returns (uint) {
}
function balanceOf(address _owner) public constant returns (uint256) {
}
function isValidSignature(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
)
public
constant
returns (bool)
{
}
function addSigner(address _newSigner) public {
}
function keccak(address _sender, address _wrapper, uint _validTill) public constant returns(bytes32) {
}
}
| now+_forTime*1hours>=depositLock[msg.sender] | 1,432 | now+_forTime*1hours>=depositLock[msg.sender] |
null | pragma solidity 0.4.24;
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* > Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an `Approval` event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/*
Copyright Ethfinex Inc 2018
Licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0
*/
contract WrapperLock is BasicToken, Ownable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public TRANSFER_PROXY_VEFX = 0xdcDb42C9a256690bd153A7B409751ADFC8Dd5851;
address public TRANSFER_PROXY_V2 = 0x95e6f48254609a6ee006f7d493c8e5fb97094cef;
mapping (address => bool) public isSigner;
string public name;
string public symbol;
uint public decimals;
address public originalToken;
mapping (address => uint256) public depositLock;
mapping (address => uint256) public balances;
function WrapperLock(address _originalToken, string _name, string _symbol, uint _decimals) Ownable() {
}
// @dev method only for testing, needs to be commented out when deploying
// function addProxy(address _addr) public {
// TRANSFER_PROXY_VEFX = _addr;
// }
function deposit(uint _value, uint _forTime) public returns (bool success) {
}
function withdraw(
uint _value,
uint8 v,
bytes32 r,
bytes32 s,
uint signatureValidUntilBlock
)
public
returns
(bool success)
{
require(<FILL_ME>)
if (now <= depositLock[msg.sender]) {
require(block.number < signatureValidUntilBlock);
require(isValidSignature(keccak256(msg.sender, address(this), signatureValidUntilBlock), v, r, s));
}
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
depositLock[msg.sender] = 0;
IERC20(originalToken).safeTransfer(msg.sender, _value);
return true;
}
function withdrawBalanceDifference() public onlyOwner returns (bool success) {
}
function withdrawDifferentToken(address _differentToken) public onlyOwner returns (bool) {
}
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint _value) public {
}
function allowance(address _owner, address _spender) public constant returns (uint) {
}
function balanceOf(address _owner) public constant returns (uint256) {
}
function isValidSignature(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
)
public
constant
returns (bool)
{
}
function addSigner(address _newSigner) public {
}
function keccak(address _sender, address _wrapper, uint _validTill) public constant returns(bytes32) {
}
}
| balanceOf(msg.sender)>=_value | 1,432 | balanceOf(msg.sender)>=_value |
null | pragma solidity 0.4.24;
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* > Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an `Approval` event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/*
Copyright Ethfinex Inc 2018
Licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0
*/
contract WrapperLock is BasicToken, Ownable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public TRANSFER_PROXY_VEFX = 0xdcDb42C9a256690bd153A7B409751ADFC8Dd5851;
address public TRANSFER_PROXY_V2 = 0x95e6f48254609a6ee006f7d493c8e5fb97094cef;
mapping (address => bool) public isSigner;
string public name;
string public symbol;
uint public decimals;
address public originalToken;
mapping (address => uint256) public depositLock;
mapping (address => uint256) public balances;
function WrapperLock(address _originalToken, string _name, string _symbol, uint _decimals) Ownable() {
}
// @dev method only for testing, needs to be commented out when deploying
// function addProxy(address _addr) public {
// TRANSFER_PROXY_VEFX = _addr;
// }
function deposit(uint _value, uint _forTime) public returns (bool success) {
}
function withdraw(
uint _value,
uint8 v,
bytes32 r,
bytes32 s,
uint signatureValidUntilBlock
)
public
returns
(bool success)
{
require(balanceOf(msg.sender) >= _value);
if (now <= depositLock[msg.sender]) {
require(block.number < signatureValidUntilBlock);
require(<FILL_ME>)
}
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
depositLock[msg.sender] = 0;
IERC20(originalToken).safeTransfer(msg.sender, _value);
return true;
}
function withdrawBalanceDifference() public onlyOwner returns (bool success) {
}
function withdrawDifferentToken(address _differentToken) public onlyOwner returns (bool) {
}
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint _value) public {
}
function allowance(address _owner, address _spender) public constant returns (uint) {
}
function balanceOf(address _owner) public constant returns (uint256) {
}
function isValidSignature(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
)
public
constant
returns (bool)
{
}
function addSigner(address _newSigner) public {
}
function keccak(address _sender, address _wrapper, uint _validTill) public constant returns(bytes32) {
}
}
| isValidSignature(keccak256(msg.sender,address(this),signatureValidUntilBlock),v,r,s) | 1,432 | isValidSignature(keccak256(msg.sender,address(this),signatureValidUntilBlock),v,r,s) |
null | pragma solidity 0.4.24;
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* > Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an `Approval` event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/*
Copyright Ethfinex Inc 2018
Licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0
*/
contract WrapperLock is BasicToken, Ownable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public TRANSFER_PROXY_VEFX = 0xdcDb42C9a256690bd153A7B409751ADFC8Dd5851;
address public TRANSFER_PROXY_V2 = 0x95e6f48254609a6ee006f7d493c8e5fb97094cef;
mapping (address => bool) public isSigner;
string public name;
string public symbol;
uint public decimals;
address public originalToken;
mapping (address => uint256) public depositLock;
mapping (address => uint256) public balances;
function WrapperLock(address _originalToken, string _name, string _symbol, uint _decimals) Ownable() {
}
// @dev method only for testing, needs to be commented out when deploying
// function addProxy(address _addr) public {
// TRANSFER_PROXY_VEFX = _addr;
// }
function deposit(uint _value, uint _forTime) public returns (bool success) {
}
function withdraw(
uint _value,
uint8 v,
bytes32 r,
bytes32 s,
uint signatureValidUntilBlock
)
public
returns
(bool success)
{
}
function withdrawBalanceDifference() public onlyOwner returns (bool success) {
require(<FILL_ME>)
IERC20(originalToken).safeTransfer(msg.sender, IERC20(originalToken).balanceOf(address(this)).sub(totalSupply_));
return true;
}
function withdrawDifferentToken(address _differentToken) public onlyOwner returns (bool) {
}
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint _value) public {
}
function allowance(address _owner, address _spender) public constant returns (uint) {
}
function balanceOf(address _owner) public constant returns (uint256) {
}
function isValidSignature(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
)
public
constant
returns (bool)
{
}
function addSigner(address _newSigner) public {
}
function keccak(address _sender, address _wrapper, uint _validTill) public constant returns(bytes32) {
}
}
| IERC20(originalToken).balanceOf(address(this)).sub(totalSupply_)>0 | 1,432 | IERC20(originalToken).balanceOf(address(this)).sub(totalSupply_)>0 |
null | pragma solidity 0.4.24;
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* > Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an `Approval` event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/*
Copyright Ethfinex Inc 2018
Licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0
*/
contract WrapperLock is BasicToken, Ownable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public TRANSFER_PROXY_VEFX = 0xdcDb42C9a256690bd153A7B409751ADFC8Dd5851;
address public TRANSFER_PROXY_V2 = 0x95e6f48254609a6ee006f7d493c8e5fb97094cef;
mapping (address => bool) public isSigner;
string public name;
string public symbol;
uint public decimals;
address public originalToken;
mapping (address => uint256) public depositLock;
mapping (address => uint256) public balances;
function WrapperLock(address _originalToken, string _name, string _symbol, uint _decimals) Ownable() {
}
// @dev method only for testing, needs to be commented out when deploying
// function addProxy(address _addr) public {
// TRANSFER_PROXY_VEFX = _addr;
// }
function deposit(uint _value, uint _forTime) public returns (bool success) {
}
function withdraw(
uint _value,
uint8 v,
bytes32 r,
bytes32 s,
uint signatureValidUntilBlock
)
public
returns
(bool success)
{
}
function withdrawBalanceDifference() public onlyOwner returns (bool success) {
}
function withdrawDifferentToken(address _differentToken) public onlyOwner returns (bool) {
require(_differentToken != originalToken);
require(<FILL_ME>)
IERC20(_differentToken).safeTransfer(msg.sender, IERC20(_differentToken).balanceOf(address(this)));
return true;
}
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint _value) public {
}
function allowance(address _owner, address _spender) public constant returns (uint) {
}
function balanceOf(address _owner) public constant returns (uint256) {
}
function isValidSignature(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
)
public
constant
returns (bool)
{
}
function addSigner(address _newSigner) public {
}
function keccak(address _sender, address _wrapper, uint _validTill) public constant returns(bytes32) {
}
}
| IERC20(_differentToken).balanceOf(address(this))>0 | 1,432 | IERC20(_differentToken).balanceOf(address(this))>0 |
null | pragma solidity 0.4.24;
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* > Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an `Approval` event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/*
Copyright Ethfinex Inc 2018
Licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0
*/
contract WrapperLock is BasicToken, Ownable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public TRANSFER_PROXY_VEFX = 0xdcDb42C9a256690bd153A7B409751ADFC8Dd5851;
address public TRANSFER_PROXY_V2 = 0x95e6f48254609a6ee006f7d493c8e5fb97094cef;
mapping (address => bool) public isSigner;
string public name;
string public symbol;
uint public decimals;
address public originalToken;
mapping (address => uint256) public depositLock;
mapping (address => uint256) public balances;
function WrapperLock(address _originalToken, string _name, string _symbol, uint _decimals) Ownable() {
}
// @dev method only for testing, needs to be commented out when deploying
// function addProxy(address _addr) public {
// TRANSFER_PROXY_VEFX = _addr;
// }
function deposit(uint _value, uint _forTime) public returns (bool success) {
}
function withdraw(
uint _value,
uint8 v,
bytes32 r,
bytes32 s,
uint signatureValidUntilBlock
)
public
returns
(bool success)
{
}
function withdrawBalanceDifference() public onlyOwner returns (bool success) {
}
function withdrawDifferentToken(address _differentToken) public onlyOwner returns (bool) {
}
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint _value) public {
require(<FILL_ME>)
assert(msg.sender == TRANSFER_PROXY_VEFX || msg.sender == TRANSFER_PROXY_V2);
balances[_to] = balances[_to].add(_value);
depositLock[_to] = depositLock[_to] > now ? depositLock[_to] : now + 1 hours;
balances[_from] = balances[_from].sub(_value);
Transfer(_from, _to, _value);
}
function allowance(address _owner, address _spender) public constant returns (uint) {
}
function balanceOf(address _owner) public constant returns (uint256) {
}
function isValidSignature(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
)
public
constant
returns (bool)
{
}
function addSigner(address _newSigner) public {
}
function keccak(address _sender, address _wrapper, uint _validTill) public constant returns(bytes32) {
}
}
| isSigner[_to]||isSigner[_from] | 1,432 | isSigner[_to]||isSigner[_from] |
null | pragma solidity 0.4.24;
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* > Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an `Approval` event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/*
Copyright Ethfinex Inc 2018
Licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0
*/
contract WrapperLock is BasicToken, Ownable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public TRANSFER_PROXY_VEFX = 0xdcDb42C9a256690bd153A7B409751ADFC8Dd5851;
address public TRANSFER_PROXY_V2 = 0x95e6f48254609a6ee006f7d493c8e5fb97094cef;
mapping (address => bool) public isSigner;
string public name;
string public symbol;
uint public decimals;
address public originalToken;
mapping (address => uint256) public depositLock;
mapping (address => uint256) public balances;
function WrapperLock(address _originalToken, string _name, string _symbol, uint _decimals) Ownable() {
}
// @dev method only for testing, needs to be commented out when deploying
// function addProxy(address _addr) public {
// TRANSFER_PROXY_VEFX = _addr;
// }
function deposit(uint _value, uint _forTime) public returns (bool success) {
}
function withdraw(
uint _value,
uint8 v,
bytes32 r,
bytes32 s,
uint signatureValidUntilBlock
)
public
returns
(bool success)
{
}
function withdrawBalanceDifference() public onlyOwner returns (bool success) {
}
function withdrawDifferentToken(address _differentToken) public onlyOwner returns (bool) {
}
function transfer(address _to, uint256 _value) public returns (bool) {
}
function transferFrom(address _from, address _to, uint _value) public {
}
function allowance(address _owner, address _spender) public constant returns (uint) {
}
function balanceOf(address _owner) public constant returns (uint256) {
}
function isValidSignature(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
)
public
constant
returns (bool)
{
}
function addSigner(address _newSigner) public {
require(<FILL_ME>)
isSigner[_newSigner] = true;
}
function keccak(address _sender, address _wrapper, uint _validTill) public constant returns(bytes32) {
}
}
| isSigner[msg.sender] | 1,432 | isSigner[msg.sender] |
"HANDLER_EXISTS_FOR_KIND" | /*
Copyright 2020 Swap Holdings Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @title TransferHandlerRegistry: holds registry of contract to
* facilitate token transfers
*/
contract TransferHandlerRegistry is Ownable {
event AddTransferHandler(
bytes4 kind,
address contractAddress
);
// Mapping of bytes4 to contract interface type
mapping (bytes4 => ITransferHandler) public transferHandlers;
/**
* @notice Adds handler to mapping
* @param kind bytes4 Key value that defines a token type
* @param transferHandler ITransferHandler
*/
function addTransferHandler(bytes4 kind, ITransferHandler transferHandler)
external onlyOwner {
require(<FILL_ME>)
transferHandlers[kind] = transferHandler;
emit AddTransferHandler(kind, address(transferHandler));
}
}
| address(transferHandlers[kind])==address(0),"HANDLER_EXISTS_FOR_KIND" | 1,438 | address(transferHandlers[kind])==address(0) |
null | pragma solidity ^0.4.25;
// 'Recordbase'
//
// NAME : Recordbase
// Symbol : RCBASE
// Total supply: 1000000
// Decimals : 18
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract ForeignToken {
function balanceOf(address _owner) constant public returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Recordbase is ERC20 {
using SafeMath for uint256;
address owner = msg.sender;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public Claimed;
string public constant name = "Recordbase";
string public constant symbol = "RCBASE";
uint public constant decimals = 18;
uint public deadline = now + 35 * 1 days;
uint public round2 = now + 30 * 1 days;
uint public round1 = now + 20 * 1 days;
uint256 public totalSupply = 1000000e18;
uint256 public totalDistributed;
uint256 public constant requestMinimum = 1 ether / 1000; // 0.01 Ether
uint256 public tokensPerEth = 2e18;
uint public target0drop = 4000;
uint public progress0drop = 0;
address multisig = 0x6A49Bd8606EEb9c42FCDbCad58C547733054c8b1;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Distr(address indexed to, uint256 amount);
event DistrFinished();
event Airdrop(address indexed _owner, uint _amount, uint _balance);
event TokensPerEthUpdated(uint _tokensPerEth);
event Burn(address indexed burner, uint256 value);
event Add(uint256 value);
bool public distributionFinished = false;
modifier canDistr() {
require(<FILL_ME>)
_;
}
modifier onlyOwner() {
}
constructor() public {
}
function transferOwnership(address newOwner) onlyOwner public {
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
}
function Distribute(address _participant, uint _amount) onlyOwner internal {
}
function DistributeAirdrop(address _participant, uint _amount) onlyOwner external {
}
function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external {
}
function updateTokensPerEth(uint _tokensPerEth) public onlyOwner {
}
function () external payable {
}
function getTokens() payable canDistr public {
}
function balanceOf(address _owner) constant public returns (uint256) {
}
modifier onlyPayloadSize(uint size) {
}
function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) constant public returns (uint256) {
}
function getTokenBalance(address tokenAddress, address who) constant public returns (uint){
}
function withdrawAll() onlyOwner public {
}
function withdraw(uint256 _wdamount) onlyOwner public {
}
function burn(uint256 _value) onlyOwner public {
}
function add(uint256 _value) onlyOwner public {
}
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
}
}
| !distributionFinished | 1,458 | !distributionFinished |
null | pragma solidity ^0.5.8;
/**
* @title SafeMaths
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* Welcome to the Telegram chat https://devsolidity.io/
*/
contract Token {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
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 Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is Token {
using SafeMath for uint256;
mapping(address => mapping (address => uint256)) internal allowed;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(<FILL_ME>)
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint256 _addedValue) public returns (bool success) {
}
function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success) {
}
}
contract PropertyCoin is StandardToken {
string public constant name = "PropertyCoin";
string public constant symbol = "PTC";
uint256 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 100000000 * (10**decimals);
address public tokenWallet;
constructor() public {
}
}
| balances[msg.sender]>=_value&&balances[_to].add(_value)>=balances[_to] | 1,474 | balances[msg.sender]>=_value&&balances[_to].add(_value)>=balances[_to] |
'INSUFFICIENT_PRIVILEGE' | pragma solidity 0.8.7;
// @TODO: Formatting
library LibBytes {
// @TODO: see if we can just set .length =
function trimToSize(bytes memory b, uint newLen)
internal
pure
{
}
/***********************************|
| Read Bytes Functions |
|__________________________________*/
/**
* @dev Reads a bytes32 value from a position in a byte array.
* @param b Byte array containing a bytes32 value.
* @param index Index in byte array of bytes32 value.
* @return result bytes32 value from byte array.
*/
function readBytes32(
bytes memory b,
uint256 index
)
internal
pure
returns (bytes32 result)
{
}
}
interface IERC1271Wallet {
function isValidSignature(bytes32 hash, bytes calldata signature) external view returns (bytes4 magicValue);
}
library SignatureValidator {
using LibBytes for bytes;
enum SignatureMode {
EIP712,
EthSign,
SmartWallet,
Spoof
}
// bytes4(keccak256("isValidSignature(bytes32,bytes)"))
bytes4 constant internal ERC1271_MAGICVALUE_BYTES32 = 0x1626ba7e;
function recoverAddr(bytes32 hash, bytes memory sig) internal view returns (address) {
}
function recoverAddrImpl(bytes32 hash, bytes memory sig, bool allowSpoofing) internal view returns (address) {
}
}
contract Identity {
mapping (address => bytes32) public privileges;
// The next allowed nonce
uint public nonce;
// Events
event LogPrivilegeChanged(address indexed addr, bytes32 priv);
event LogErr(address indexed to, uint value, bytes data, bytes returnData); // only used in tryCatch
// Transaction structure
// we handle replay protection separately by requiring (address(this), chainID, nonce) as part of the sig
struct Transaction {
address to;
uint value;
bytes data;
}
constructor(address[] memory addrs) {
}
// This contract can accept ETH without calldata
receive() external payable {}
// This contract can accept ETH with calldata
// However, to support EIP 721 and EIP 1155, we need to respond to those methods with their own method signature
fallback() external payable {
}
function setAddrPrivilege(address addr, bytes32 priv)
external
{
}
function tipMiner(uint amount)
external
{
}
function tryCatch(address to, uint value, bytes calldata data)
external
{
}
// WARNING: if the signature of this is changed, we have to change IdentityFactory
function execute(Transaction[] calldata txns, bytes calldata signature)
external
{
require(txns.length > 0, 'MUST_PASS_TX');
uint currentNonce = nonce;
// NOTE: abi.encode is safer than abi.encodePacked in terms of collision safety
bytes32 hash = keccak256(abi.encode(address(this), block.chainid, currentNonce, txns));
// We have to increment before execution cause it protects from reentrancies
nonce = currentNonce + 1;
address signer = SignatureValidator.recoverAddrImpl(hash, signature, true);
require(<FILL_ME>)
uint len = txns.length;
for (uint i=0; i<len; i++) {
Transaction memory txn = txns[i];
executeCall(txn.to, txn.value, txn.data);
}
// The actual anti-bricking mechanism - do not allow a signer to drop their own priviledges
require(privileges[signer] != bytes32(0), 'PRIVILEGE_NOT_DOWNGRADED');
}
// no need for nonce management here cause we're not dealing with sigs
function executeBySender(Transaction[] calldata txns) external {
}
function executeBySelf(Transaction[] calldata txns) external {
}
// we shouldn't use address.call(), cause: https://github.com/ethereum/solidity/issues/2884
// copied from https://github.com/uport-project/uport-identity/blob/develop/contracts/Proxy.sol
// there's also
// https://github.com/gnosis/MultiSigWallet/commit/e1b25e8632ca28e9e9e09c81bd20bf33fdb405ce
// https://github.com/austintgriffith/bouncer-proxy/blob/master/BouncerProxy/BouncerProxy.sol
// https://github.com/gnosis/safe-contracts/blob/7e2eeb3328bb2ae85c36bc11ea6afc14baeb663c/contracts/base/Executor.sol
function executeCall(address to, uint256 value, bytes memory data)
internal
{
}
// EIP 1271 implementation
// see https://eips.ethereum.org/EIPS/eip-1271
function isValidSignature(bytes32 hash, bytes calldata signature) external view returns (bytes4) {
}
// EIP 1155 implementation
// we pretty much only need to signal that we support the interface for 165, but for 1155 we also need the fallback function
function supportsInterface(bytes4 interfaceID) external pure returns (bool) {
}
}
| privileges[signer]!=bytes32(0),'INSUFFICIENT_PRIVILEGE' | 1,541 | privileges[signer]!=bytes32(0) |
'INSUFFICIENT_PRIVILEGE' | pragma solidity 0.8.7;
// @TODO: Formatting
library LibBytes {
// @TODO: see if we can just set .length =
function trimToSize(bytes memory b, uint newLen)
internal
pure
{
}
/***********************************|
| Read Bytes Functions |
|__________________________________*/
/**
* @dev Reads a bytes32 value from a position in a byte array.
* @param b Byte array containing a bytes32 value.
* @param index Index in byte array of bytes32 value.
* @return result bytes32 value from byte array.
*/
function readBytes32(
bytes memory b,
uint256 index
)
internal
pure
returns (bytes32 result)
{
}
}
interface IERC1271Wallet {
function isValidSignature(bytes32 hash, bytes calldata signature) external view returns (bytes4 magicValue);
}
library SignatureValidator {
using LibBytes for bytes;
enum SignatureMode {
EIP712,
EthSign,
SmartWallet,
Spoof
}
// bytes4(keccak256("isValidSignature(bytes32,bytes)"))
bytes4 constant internal ERC1271_MAGICVALUE_BYTES32 = 0x1626ba7e;
function recoverAddr(bytes32 hash, bytes memory sig) internal view returns (address) {
}
function recoverAddrImpl(bytes32 hash, bytes memory sig, bool allowSpoofing) internal view returns (address) {
}
}
contract Identity {
mapping (address => bytes32) public privileges;
// The next allowed nonce
uint public nonce;
// Events
event LogPrivilegeChanged(address indexed addr, bytes32 priv);
event LogErr(address indexed to, uint value, bytes data, bytes returnData); // only used in tryCatch
// Transaction structure
// we handle replay protection separately by requiring (address(this), chainID, nonce) as part of the sig
struct Transaction {
address to;
uint value;
bytes data;
}
constructor(address[] memory addrs) {
}
// This contract can accept ETH without calldata
receive() external payable {}
// This contract can accept ETH with calldata
// However, to support EIP 721 and EIP 1155, we need to respond to those methods with their own method signature
fallback() external payable {
}
function setAddrPrivilege(address addr, bytes32 priv)
external
{
}
function tipMiner(uint amount)
external
{
}
function tryCatch(address to, uint value, bytes calldata data)
external
{
}
// WARNING: if the signature of this is changed, we have to change IdentityFactory
function execute(Transaction[] calldata txns, bytes calldata signature)
external
{
}
// no need for nonce management here cause we're not dealing with sigs
function executeBySender(Transaction[] calldata txns) external {
require(txns.length > 0, 'MUST_PASS_TX');
require(<FILL_ME>)
uint len = txns.length;
for (uint i=0; i<len; i++) {
Transaction memory txn = txns[i];
executeCall(txn.to, txn.value, txn.data);
}
// again, anti-bricking
require(privileges[msg.sender] != bytes32(0), 'PRIVILEGE_NOT_DOWNGRADED');
}
function executeBySelf(Transaction[] calldata txns) external {
}
// we shouldn't use address.call(), cause: https://github.com/ethereum/solidity/issues/2884
// copied from https://github.com/uport-project/uport-identity/blob/develop/contracts/Proxy.sol
// there's also
// https://github.com/gnosis/MultiSigWallet/commit/e1b25e8632ca28e9e9e09c81bd20bf33fdb405ce
// https://github.com/austintgriffith/bouncer-proxy/blob/master/BouncerProxy/BouncerProxy.sol
// https://github.com/gnosis/safe-contracts/blob/7e2eeb3328bb2ae85c36bc11ea6afc14baeb663c/contracts/base/Executor.sol
function executeCall(address to, uint256 value, bytes memory data)
internal
{
}
// EIP 1271 implementation
// see https://eips.ethereum.org/EIPS/eip-1271
function isValidSignature(bytes32 hash, bytes calldata signature) external view returns (bytes4) {
}
// EIP 1155 implementation
// we pretty much only need to signal that we support the interface for 165, but for 1155 we also need the fallback function
function supportsInterface(bytes4 interfaceID) external pure returns (bool) {
}
}
| privileges[msg.sender]!=bytes32(0),'INSUFFICIENT_PRIVILEGE' | 1,541 | privileges[msg.sender]!=bytes32(0) |