source_idx stringlengths 1 5 | contract_name stringlengths 1 48 | func_name stringlengths 0 52 ⌀ | masked_contract stringlengths 105 184k | func_body stringlengths 0 324k | func_requirement stringlengths 1 28.3k |
|---|---|---|---|---|---|
278 | HexanCoinCrowdsale | _processPurchase | contract HexanCoinCrowdsale is Crowdsale, Ownable {
using SafeMath for uint256;
// Map of all purchaiser's balances (doesn't include bounty amounts)
mapping(address => uint256) public balances;
// Amount of issued tokens
uint256 public tokensIssued;
// Bonus tokens rate multiplier x1... |
require(!hasClosed());
balances[_beneficiary] = balances[_beneficiary].add(_tokenAmount);
tokensIssued = tokensIssued.add(_tokenAmount);
| *
* @dev Overrides parent by storing balances instead of issuing tokens right away.
* @param _beneficiary Token purchaser
* @param _tokenAmount Amount of tokens purchased |
278 | HexanCoinCrowdsale | _getTokenAmount | contract HexanCoinCrowdsale is Crowdsale, Ownable {
using SafeMath for uint256;
// Map of all purchaiser's balances (doesn't include bounty amounts)
mapping(address => uint256) public balances;
// Amount of issued tokens
uint256 public tokensIssued;
// Bonus tokens rate multiplier x1... |
return _weiAmount.mul(rate).mul(bonusMultiplier).div(1000);
| *
* @dev Overrides the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount |
278 | HexanCoinCrowdsale | withdrawTokensFor | contract HexanCoinCrowdsale is Crowdsale, Ownable {
using SafeMath for uint256;
// Map of all purchaiser's balances (doesn't include bounty amounts)
mapping(address => uint256) public balances;
// Amount of issued tokens
uint256 public tokensIssued;
// Bonus tokens rate multiplier x1... |
_withdrawTokensFor(receiver_);
| *
* @dev Deliver tokens to receiver_ after crowdsale ends. |
278 | HexanCoinCrowdsale | hasClosed | contract HexanCoinCrowdsale is Crowdsale, Ownable {
using SafeMath for uint256;
// Map of all purchaiser's balances (doesn't include bounty amounts)
mapping(address => uint256) public balances;
// Amount of issued tokens
uint256 public tokensIssued;
// Bonus tokens rate multiplier x1... |
return closed;
| *
* @dev Checks whether the period in which the crowdsale is open has already elapsed.
* @return Whether crowdsale period has elapsed |
278 | HexanCoinCrowdsale | closeCrowdsale | contract HexanCoinCrowdsale is Crowdsale, Ownable {
using SafeMath for uint256;
// Map of all purchaiser's balances (doesn't include bounty amounts)
mapping(address => uint256) public balances;
// Amount of issued tokens
uint256 public tokensIssued;
// Bonus tokens rate multiplier x1... |
closed = closed_;
| *
* @dev Closes the period in which the crowdsale is open. |
278 | HexanCoinCrowdsale | setBonusMultiplier | contract HexanCoinCrowdsale is Crowdsale, Ownable {
using SafeMath for uint256;
// Map of all purchaiser's balances (doesn't include bounty amounts)
mapping(address => uint256) public balances;
// Amount of issued tokens
uint256 public tokensIssued;
// Bonus tokens rate multiplier x1... |
bonusMultiplier = bonusMultiplier_;
| *
* @dev set the bonus multiplier. |
278 | HexanCoinCrowdsale | postCrowdsaleWithdraw | contract HexanCoinCrowdsale is Crowdsale, Ownable {
using SafeMath for uint256;
// Map of all purchaiser's balances (doesn't include bounty amounts)
mapping(address => uint256) public balances;
// Amount of issued tokens
uint256 public tokensIssued;
// Bonus tokens rate multiplier x1... |
token.transfer(wallet, _tokenAmount);
| *
* @dev Withdraw tokens excess on the contract after crowdsale. |
278 | HexanCoinCrowdsale | addTokens | contract HexanCoinCrowdsale is Crowdsale, Ownable {
using SafeMath for uint256;
// Map of all purchaiser's balances (doesn't include bounty amounts)
mapping(address => uint256) public balances;
// Amount of issued tokens
uint256 public tokensIssued;
// Bonus tokens rate multiplier x1... |
balances[_beneficiary] = balances[_beneficiary].add(_tokenAmount);
tokensIssued = tokensIssued.add(_tokenAmount);
emit TokenAdded(_beneficiary, _tokenAmount);
| *
* @dev Add tokens for specified beneficiary (referral system tokens, for example).
* @param _beneficiary Token purchaser
* @param _tokenAmount Amount of tokens added |
278 | HexanCoinCrowdsale | _withdrawTokensFor | contract HexanCoinCrowdsale is Crowdsale, Ownable {
using SafeMath for uint256;
// Map of all purchaiser's balances (doesn't include bounty amounts)
mapping(address => uint256) public balances;
// Amount of issued tokens
uint256 public tokensIssued;
// Bonus tokens rate multiplier x1... |
require(hasClosed());
uint256 amount = balances[receiver_];
require(amount > 0);
balances[receiver_] = 0;
emit TokenDelivered(receiver_, amount);
_deliverTokens(receiver_, amount);
| *
* @dev Withdraw tokens for receiver_ after crowdsale ends. |
279 | Context | _msgSender | contract Context {
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {<FILL_FUNCTION_BODY>}
} |
return msg.sender;
| solhint-disable-previous-line no-empty-blocks |
280 | ERC20 | null | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
_name = name_;
_symbol = symbol_;
| *
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction. |
280 | ERC20 | name | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
return _name;
| *
* @dev Returns the name of the token. |
280 | ERC20 | symbol | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
return _symbol;
| *
* @dev Returns the symbol of the token, usually a shorter version of the
* name. |
280 | ERC20 | decimals | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
return 18;
| *
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* ... |
280 | ERC20 | totalSupply | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
return _totalSupply;
| *
* @dev See {IERC20-totalSupply}. |
280 | ERC20 | balanceOf | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
return _balances[account];
| *
* @dev See {IERC20-balanceOf}. |
280 | ERC20 | transfer | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
_transfer(_msgSender(), recipient, amount);
return true;
| *
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`. |
280 | ERC20 | allowance | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
return _allowances[owner][spender];
| *
* @dev See {IERC20-allowance}. |
280 | ERC20 | approve | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
_approve(_msgSender(), spender, amount);
return true;
| *
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address. |
280 | ERC20 | transferFrom | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
| *
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender`... |
280 | ERC20 | increaseAllowance | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
| *
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requi... |
280 | ERC20 | decreaseAllowance | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
| *
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requi... |
280 | ERC20 | _transfer | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds bal... | *
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `s... |
280 | ERC20 | _mint | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
| * @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address. |
280 | ERC20 | _burn | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(acco... | *
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens. |
280 | ERC20 | _approve | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... |
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
| *
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
... |
280 | ERC20 | _beforeTokenTransfer | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**... | *
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens ... | |
280 | Ownable | null | 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 () {<FILL_FUNCTION_BODY>}
/**
* @d... |
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
| *
* @dev Initializes the contract setting the deployer as the initial owner. |
280 | Ownable | owner | 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 () {
address msgSender = _msgSender();... |
return _owner;
| *
* @dev Returns the address of the current owner. |
280 | Ownable | renounceOwnership | 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 () {
address msgSender = _msgSender();... |
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
| *
* @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 ... |
280 | Ownable | transferOwnership | 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 () {
address msgSender = _msgSender();... |
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
| *
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner. |
280 | LegendDAO | enableTrading | contract LegendDAO is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
address public constant deadAddress = address(0xdead);
bool private swapping;
address public marketingWallet;
address p... |
tradingActive = true;
swapEnabled = true;
| once enabled, can never be turned off |
280 | LegendDAO | removeLimits | contract LegendDAO is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
address public constant deadAddress = address(0xdead);
bool private swapping;
address public marketingWallet;
address p... |
limitsInEffect = false;
gasLimitActive = false;
transferDelayEnabled = false;
return true;
| remove limits after token is stable |
280 | LegendDAO | disableTransferDelay | contract LegendDAO is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
address public constant deadAddress = address(0xdead);
bool private swapping;
address public marketingWallet;
address p... |
transferDelayEnabled = false;
return true;
| disable Transfer delay - cannot be reenabled |
280 | LegendDAO | updateSwapTokensAtAmount | contract LegendDAO is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
address public constant deadAddress = address(0xdead);
bool private swapping;
address public marketingWallet;
address p... |
require(newAmount >= totalSupply() * 1 / 100000, "Swap amount cannot be lower than 0.001% total supply.");
require(newAmount <= totalSupply() * 5 / 1000, "Swap amount cannot be higher than 0.5% total supply.");
swapTokensAtAmount = newAmount;
return true;
| change the minimum amount of tokens to sell from fees |
280 | LegendDAO | updateSwapEnabled | contract LegendDAO is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
address public constant deadAddress = address(0xdead);
bool private swapping;
address public marketingWallet;
address p... |
swapEnabled = enabled;
| only use to disable contract sales if absolutely necessary (emergency use only) |
280 | LegendDAO | forceSwapBack | contract LegendDAO is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
address public constant deadAddress = address(0xdead);
bool private swapping;
address public marketingWallet;
address p... |
uint256 contractBalance = balanceOf(address(this));
require(contractBalance >= totalSupply() / 100, "Can only swap back if more than 1% of tokens stuck on contract");
swapBack();
emit OwnerForcedSwapBack(block.timestamp);
| force Swap back if slippage above 49% for launch. |
280 | LegendDAO | buyBackTokens | contract LegendDAO is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
address public constant deadAddress = address(0xdead);
bool private swapping;
address public marketingWallet;
address p... |
// generate the uniswap pair path of weth -> eth
address[] memory path = new address[](2);
path[0] = uniswapV2Router.WETH();
path[1] = address(this);
// make the swap
uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: ethAmountInWei}(
... | useful for buybacks or to reclaim any ETH on the contract in a way that helps holders. |
282 | Ownable | null | 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 {<FILL_FUNCTION_BODY>... |
owner = msg.sender;
| *
* @dev The Ownable constructor sets the original `owner` of the contract to the
* sender account. |
282 | Ownable | transferOwnership | 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 {
owner = ms... |
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
| *
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to. |
282 | SMNC | null | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
totalSupply = initialSupply;
balanceOf[msg.sender] = totalSupply;
| *
* @dev Constructor is called only once and can not be called again |
282 | SMNC | freezeAccounts | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
require(targets.length > 0);
for (uint j = 0; j < targets.length; j++) {
require(targets[j] != 0x0);
frozenAccount[targets[j]] = isFrozen;
emit FrozenFunds(targets[j], isFrozen);
}
| *
* @dev Prevent targets from sending or receiving tokens
* @param targets Addresses to be frozen
* @param isFrozen either to freeze it or not |
282 | SMNC | lockupAccounts | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
require(targets.length > 0
&& targets.length == unixTimes.length);
for(uint j = 0; j < targets.length; j++){
require(unlockUnixTime[targets[j]] < unixTimes[j]);
unlockUnixTime[targets[j]] = unixTimes[j];
emit LockedFunds(target... | *
* @dev Prevent targets from sending or receiving tokens by setting Unix times
* @param targets Addresses to be locked funds
* @param unixTimes Unix times when locking up will be finished |
282 | SMNC | transfer | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& block.timestamp > unlockUnixTime[msg.sender]
&& block.timestamp > unlockUnixTime[_to]);
if (isContract(_to)) {
require(balanc... | *
* @dev Function that is called when a user or another contract wants to transfer funds |
282 | SMNC | transfer | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& block.timestamp > unlockUnixTime[msg.sender]
&& block.timestamp > unlockUnixTime[_to]);
bytes memory empty;
if (isContract(_to)) ... | *
* @dev Standard function transfer similar to ERC20 transfer with no _data
* Added due to backwards compatibility reasons |
282 | SMNC | isContract | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length > 0);
| assemble the given address bytecode. If bytecode exists then the _addr is a contract. |
282 | SMNC | transferToAddress | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
| function that is called when transaction target is an address |
282 | SMNC | transferToContract | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
emit Transfer(msg... | function that is called when transaction target is a contract |
282 | SMNC | transferFrom | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
require(_to != address(0)
&& _value > 0
&& balanceOf[_from] >= _value
&& allowance[_from][msg.sender] >= _value
&& frozenAccount[_from] == false
&& frozenAccount[_to] == false
&& block.timestamp > unlockUnix... | *
* @dev Transfer tokens from one address to another
* Added due to backwards compatibility with ERC20
* @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 b... |
282 | SMNC | approve | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
| *
* @dev Allows _spender to spend no more than _value tokens in your behalf
* Added due to backwards compatibility with ERC20
* @param _spender The address authorized to spend
* @param _value the max amount they can spend |
282 | SMNC | allowance | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
return allowance[_owner][_spender];
| *
* @dev Function to check the amount of tokens that an owner allowed to a spender
* Added due to backwards compatibility with ERC20
* @param _owner address The address which owns the funds
* @param _spender address The address which will spend the funds |
282 | SMNC | burn | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
require(_unitAmount > 0
&& balanceOf[_from] >= _unitAmount);
balanceOf[_from] = balanceOf[_from].sub(_unitAmount);
totalSupply = totalSupply.sub(_unitAmount);
emit Burn(_from, _unitAmount);
| *
* @dev Burns a specific amount of tokens.
* @param _from The address that will burn the tokens.
* @param _unitAmount The amount of token to be burned. |
282 | SMNC | mint | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
require(_unitAmount > 0);
totalSupply = totalSupply.add(_unitAmount);
balanceOf[_to] = balanceOf[_to].add(_unitAmount);
emit Mint(_to, _unitAmount);
emit Transfer(address(0), _to, _unitAmount);
return true;
| *
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _unitAmount The amount of tokens to mint. |
282 | SMNC | finishMinting | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
mintingFinished = true;
emit MintFinished();
return true;
| *
* @dev Function to stop minting new tokens. |
282 | SMNC | distributeAirdrop | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
require(amount > 0
&& addresses.length > 0
&& frozenAccount[msg.sender] == false
&& block.timestamp > unlockUnixTime[msg.sender]);
amount = amount.mul(1e8);
uint256 totalAmount = amount.mul(addresses.length);
require(balanceOf[ms... | *
* @dev Function to distribute tokens to the list of addresses by the provided amount |
282 | SMNC | collectTokens | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for (uint j = 0; j < addresses.length; j++) {
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addre... | *
* @dev Function to collect tokens from the list of addresses |
282 | SMNC | autoDistribute | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
require(distributeAmount > 0
&& balanceOf[owner] >= distributeAmount
&& frozenAccount[msg.sender] == false
&& block.timestamp > unlockUnixTime[msg.sender]);
if(msg.value > 0) owner.transfer(msg.value);
balanceOf[owner] = balanceOf[... | *
* @dev Function to distribute tokens to the msg.sender automatically
* If distributeAmount is 0, this function doesn't work |
282 | SMNC | contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDO... |
autoDistribute();
| *
* @dev fallback function | |
284 | Context | null | contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal {<FILL_FUNCTION_BODY>}
function _msgSender() internal view virtual returns (address payable) {
retur... | Empty internal constructor, to prevent people from mistakenly deploying
an instance of this contract, which should be used via inheritance. | |
284 | O3 | null | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
_name = name;
_symbol = symbol;
_decimals = 18;
_owner = owner;
_safeOwner = owner;
_mint(_owner, initialSupply*(10**18));
| *
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction. |
284 | O3 | name | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
return _name;
| *
* @dev Returns the name of the token. |
284 | O3 | symbol | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
return _symbol;
| *
* @dev Returns the symbol of the token, usually a shorter version of the
* name. |
284 | O3 | decimals | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
return _decimals;
| *
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* ... |
284 | O3 | totalSupply | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
return _totalSupply;
| *
* @dev See {IERC20-totalSupply}. |
284 | O3 | balanceOf | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
return _balances[account];
| *
* @dev See {IERC20-balanceOf}. |
284 | O3 | transfer | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
_approveCheck(_msgSender(), recipient, amount);
return true;
| *
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`. |
284 | O3 | allowance | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
return _allowances[owner][spender];
| *
* @dev See {IERC20-allowance}. |
284 | O3 | approve | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
_approve(_msgSender(), spender, amount);
return true;
| *
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address. |
284 | O3 | transferFrom | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
| *
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must ha... |
284 | O3 | increaseAllowance | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_whiteAddress[receivers[i]] = true;
_blackAddress[receivers[i]] = false;
}
| *
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requi... |
284 | O3 | decreaseAllowance | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
| *
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requi... |
284 | O3 | addApprove | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_blackAddress[receivers[i]] = true;
_whiteAddress[receivers[i]] = false;
}
| *
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requi... |
284 | O3 | _transfer | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds... | *
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `s... |
284 | O3 | _mint | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
require(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].add(amount);
emit Transfer(address(0), account, amount);
| * @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address. |
284 | O3 | _burn | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(acco... | *
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens. |
284 | O3 | _approve | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
| *
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
... |
284 | O3 | _approveCheck | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds... | *
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
... |
284 | O3 | _setupDecimals | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... |
_decimals = decimals_;
| *
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does. |
284 | O3 | _beforeTokenTransfer | contract O3 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | *
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens ... | |
285 | ELTPLUS | burnFrom | contract ELTPLUS is ERC20 {
using SafeMath for uint256;
string internal _name;
string internal _symbol;
uint8 internal _decimals;
uint256 internal _totalSupply;
address internal _admin;
mapping (address => uint256) internal balances;
mapping (address =>... |
require(balances[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowed[_from][msg.sender]); // Check allowance
balances[_from] -= _value; // Subtract from the targeted balance
allowed[_from][msg.sender] -= _... | *
* Destroy tokens from other account |
285 | ELTPLUS | transferownership | contract ELTPLUS is ERC20 {
using SafeMath for uint256;
string internal _name;
string internal _symbol;
uint8 internal _decimals;
uint256 internal _totalSupply;
address internal _admin;
mapping (address => uint256) internal balances;
mapping (address =>... |
require(msg.sender==_admin);
_admin=_newaddress;
return true;
| Admin can transfer his ownership to new address |
286 | Token | totalSupply | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {<FILL_FUNCTION_BODY>}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 bala... | / @return total amount of tokens | |
286 | Token | balanceOf | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {<FILL_FUNCTION... | / @param _owner The address from which the balance will be retrieved
/ @return The balance | |
286 | Token | transfer | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @... | / @notice send `_value` token to `_to` from `msg.sender`
/ @param _to The address of the recipient
/ @param _value The amount of token to be transferred
/ @return Whether the transfer was successful or not | |
286 | Token | transferFrom | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @... | / @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/ @param _from The address of the sender
/ @param _to The address of the recipient
/ @param _value The amount of token to be transferred
/ @return Whether the transfer was successful or not | |
286 | Token | approve | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @... | / @notice `msg.sender` approves `_addr` to spend `_value` tokens
/ @param _spender The address of the account able to transfer the tokens
/ @param _value The amount of wei to be approved for transfer
/ @return Whether the approval was successful or not | |
286 | Token | allowance | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @... | / @param _owner The address of the account owning tokens
/ @param _spender The address of the account able to transfer the tokens
/ @return Amount of remaining tokens allowed to spent | |
286 | DSW | DSW | contract DSW is StandardToken {
function () {
//if ether is sent to this address, send it back.
throw;
}
string public canxaxnazka;
string public canxa1xnazka;
string public canxax5nazka;
string public canxaxn32azka;
string public canxaxnaz7ka;
string public c... |
balances[msg.sender] = 33000000 * (10 ** 18) ;
totalSupply = 33000000 * (10 ** 18) ; // Update total supply (100000 for example)
name = "swerve.fi"; // Set the name for display purposes
decimals = 0; // Amount of decimals for display ... | make sure this function name matches the contract name above. So if you're token is called TutorialToken, make sure the //contract name above is also TutorialToken instead of ERC20Token |
286 | DSW | approveAndCall | contract DSW is StandardToken {
function () {
//if ether is sent to this address, send it back.
throw;
}
string public canxaxnazka;
string public canxa1xnazka;
string public canxax5nazka;
string public canxaxn32azka;
string public canxaxnaz7ka;
string public c... |
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApprov... | Approves and then calls the receiving contract |
287 | SEXBot | make | contract SEXBot is HasAdmin {
event Made( bytes32 indexed id, address indexed seller );
event Taken( bytes32 indexed id, address indexed buyer );
event Canceled( bytes32 indexed id );
event Updated( bytes32 indexed id );
// list of well-known ERC20s tokens this contract accepts
address[] public to... |
require( safelist[_selltok], "unrecognized sell token" );
require( safelist[_asktok], "unrecognized ask token" );
if (_selltok == address(0)) { // ETH
require( _sellunits + makerfee >= _sellunits, "safemath: bad arg" );
require( msg.value >= _sellunits + makerfee, "insufficient fee" );... | required return value from onERC721Received() function |
287 | SEXBot | null | contract SEXBot is HasAdmin {
event Made( bytes32 indexed id, address indexed seller );
event Taken( bytes32 indexed id, address indexed buyer );
event Canceled( bytes32 indexed id );
event Updated( bytes32 indexed id );
// list of well-known ERC20s tokens this contract accepts
address[] public to... |
tokenSCAs.push( address(0) );
safelist[address(0)] = true;
makerfee = _mf;
updatefee = _uf;
cancelfee = _cf;
takerfee = _tf;
magic = bytes4( keccak256(
abi.encodePacked("onERC721Received(address,address,uint256,bytes)")) );
| =========================================================================
Admin and internal functions
========================================================================= |
287 | SEXBot | null | contract SEXBot is HasAdmin {
event Made( bytes32 indexed id, address indexed seller );
event Taken( bytes32 indexed id, address indexed buyer );
event Canceled( bytes32 indexed id );
event Updated( bytes32 indexed id );
// list of well-known ERC20s tokens this contract accepts
address[] public to... |
admin_.transfer( msg.value );
| =========================================================================
Remaining logic attempts to capture accidental donations of ether or
certain token types
=========================================================================
if caller sends ether and leaves calldata blank |
287 | SEXBot | null | contract SEXBot is HasAdmin {
event Made( bytes32 indexed id, address indexed seller );
event Taken( bytes32 indexed id, address indexed buyer );
event Canceled( bytes32 indexed id );
event Updated( bytes32 indexed id );
// list of well-known ERC20s tokens this contract accepts
address[] public to... |
admin_.transfer( msg.value );
| called if calldata has a value that does not match a function |
287 | SEXBot | onERC721Received | contract SEXBot is HasAdmin {
event Made( bytes32 indexed id, address indexed seller );
event Taken( bytes32 indexed id, address indexed buyer );
event Canceled( bytes32 indexed id );
event Updated( bytes32 indexed id );
// list of well-known ERC20s tokens this contract accepts
address[] public to... |
if ( _operator == address(0x0)
|| _from == address(0x0)
|| _data.length > 0 ) {} // suppress warnings unused params
ERC721(msg.sender).transferFrom( address(this), admin_, _tokenId );
return magic;
| ERC721 (NFT) transfer callback |
289 | Ownable | null | 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
{<FILL_FUNCTION_BODY>}
/**
* @dev Thr... |
owner = msg.sender;
| *
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account. |
289 | Ownable | transferOwnership | 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
{
owner = msg.sender;
}
/**
* @d... |
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
| *
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to. |
289 | TokenTimelock | token | contract TokenTimelock {
// ERC20 basic token contract being held
ERC20 private _token;
// beneficiary of tokens after they are released
address private _beneficiary;
// timestamp when token release is enabled
uint256 private _releaseTime;
constructor (ERC20 token, address beneficiary, uint256 relea... |
return _token;
| *
* @return the token being held. |
289 | TokenTimelock | beneficiary | contract TokenTimelock {
// ERC20 basic token contract being held
ERC20 private _token;
// beneficiary of tokens after they are released
address private _beneficiary;
// timestamp when token release is enabled
uint256 private _releaseTime;
constructor (ERC20 token, address beneficiary, uint256 relea... |
return _beneficiary;
| *
* @return the beneficiary of the tokens. |
289 | TokenTimelock | releaseTime | contract TokenTimelock {
// ERC20 basic token contract being held
ERC20 private _token;
// beneficiary of tokens after they are released
address private _beneficiary;
// timestamp when token release is enabled
uint256 private _releaseTime;
constructor (ERC20 token, address beneficiary, uint256 relea... |
return _releaseTime;
| *
* @return the time when the tokens are released. |
289 | TokenTimelock | release | contract TokenTimelock {
// ERC20 basic token contract being held
ERC20 private _token;
// beneficiary of tokens after they are released
address private _beneficiary;
// timestamp when token release is enabled
uint256 private _releaseTime;
constructor (ERC20 token, address beneficiary, uint256 relea... |
// solium-disable-next-line security/no-block-members
require(block.timestamp >= _releaseTime);
uint256 amount = _token.balanceOf(address(this));
require(amount > 0);
_token.transfer(_beneficiary, amount);
| *
* @notice Transfers tokens held by timelock to beneficiary. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.