contract_name
stringlengths
1
61
file_path
stringlengths
5
50.4k
contract_address
stringlengths
42
42
language
stringclasses
1 value
class_name
stringlengths
1
61
class_code
stringlengths
4
330k
class_documentation
stringlengths
0
29.1k
class_documentation_type
stringclasses
6 values
func_name
stringlengths
0
62
func_code
stringlengths
1
303k
func_documentation
stringlengths
2
14.9k
func_documentation_type
stringclasses
4 values
compiler_version
stringlengths
15
42
license_type
stringclasses
14 values
swarm_source
stringlengths
0
71
meta
dict
__index_level_0__
int64
0
60.4k
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
balanceOf
function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
/** * @dev See {IERC20-balanceOf}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 2140, 2264 ] }
5,500
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _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`. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 2472, 2652 ] }
5,501
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {IERC20-allowance}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 2710, 2866 ] }
5,502
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 3008, 3182 ] }
5,503
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _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` must have a balance of at least `amou...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 3651, 3977 ] }
5,504
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _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. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 4381, 4604 ] }
5,505
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _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. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 5102, 5376 ] }
5,506
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_transfer
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sen...
/** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. *...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 5861, 6405 ] }
5,507
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_mint
function _mint(address account, uint256 amount) internal virtual { 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 Transfe...
/** @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. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 6681, 7064 ] }
5,508
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_burn
function _burn(address account, uint256 amount) internal virtual { 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 = _to...
/** * @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. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 7391, 7814 ] }
5,509
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_approve
function _approve(address owner, address spender, uint256 amount) internal virtual { 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, amoun...
/** * @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: * * - `owner` cannot be the zero...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 8249, 8600 ] }
5,510
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_setupDecimals
function _setupDecimals(uint8 decimals_) internal { _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. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 8927, 9022 ] }
5,511
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_beforeTokenTransfer
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
/** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * -...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 9620, 9717 ] }
5,512
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
RiyadhCityToken
contract RiyadhCityToken is ERC20("RIYADH.cityswap.io", "RIYADH"), Ownable { uint256 public constant MAX_SUPPLY = 5041000 * 10**18; /** * @notice Creates `_amount` token to `_to`. Must only be called by the owner (TravelAgency). */ function mint(address _to, uint256 _amount) ...
// CityToken with Governance.
LineComment
mint
function mint(address _to, uint256 _amount) public onlyOwner { uint256 _totalSupply = totalSupply(); if(_totalSupply.add(_amount) > MAX_SUPPLY) { _amount = MAX_SUPPLY.sub(_totalSupply); } require(_totalSupply.add(_amount) <= MAX_SUPPLY); _mint(_to, _amount); }
/** * @notice Creates `_amount` token to `_to`. Must only be called by the owner (TravelAgency). */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 272, 622 ] }
5,513
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
RiyadhAgency
contract RiyadhAgency is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
add
function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; totalAllocPoint = totalAllocPoint.add(_allocPoint); poolInfo.push(PoolInfo({ ...
// Add a new lp to the pool. Can only be called by the owner. // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 3008, 3530 ] }
5,514
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
RiyadhAgency
contract RiyadhAgency is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
set
function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint); poolInfo[_pid].allocPoint = _allocPoint; }
// Update the given pool's CITY allocation point. Can only be called by the owner.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 3621, 3930 ] }
5,515
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
RiyadhAgency
contract RiyadhAgency is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
getMultiplier
function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { if (_to <= bonusEndBlock) { return _to.sub(_from).mul(BONUS_MULTIPLIER); } else if (_from >= bonusEndBlock) { return _to.sub(_from); } else { return bonusEndBlock.sub(_from).mul(BONUS_MULTIPLIER)...
// Return reward multiplier over the given _from to _to block.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 4001, 4429 ] }
5,516
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
RiyadhAgency
contract RiyadhAgency is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
pendingCity
function pendingCity(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accCityPerShare = pool.accCityPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (block.number >...
// View function to see pending CITYs on frontend.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 4488, 5252 ] }
5,517
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
RiyadhAgency
contract RiyadhAgency is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
massUpdatePools
function massUpdatePools() public { uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { updatePool(pid); } }
// Update reward vairables for all pools. Be careful of gas spending!
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 5330, 5515 ] }
5,518
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
RiyadhAgency
contract RiyadhAgency is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
mint
function mint(uint256 amount) public onlyOwner{ city.mint(devaddr, amount); }
// Update reward variables of the given pool to be up-to-date.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 5584, 5680 ] }
5,519
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
RiyadhAgency
contract RiyadhAgency is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
updatePool
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardBlock = block.number; return; } ...
// Update reward variables of the given pool to be up-to-date.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 5749, 6541 ] }
5,520
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
RiyadhAgency
contract RiyadhAgency is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
deposit
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accCityPerShare).div(1e12).sub(user.rewardDebt); safe...
// Deposit LP tokens to TravelAgency for CITY allocation.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 6607, 7268 ] }
5,521
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
RiyadhAgency
contract RiyadhAgency is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
withdraw
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = user.amount.mul(pool.accCityPerShare).div(1e12).sub(us...
// Withdraw LP tokens from MasterChef.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 7315, 7972 ] }
5,522
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
RiyadhAgency
contract RiyadhAgency is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
emergencyWithdraw
function emergencyWithdraw(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; pool.lpToken.safeTransfer(address(msg.sender), user.amount); emit EmergencyWithdraw(msg.sender, _pid, user.amount); user.amount = 0; user.rewardDebt...
// Withdraw without caring about rewards. EMERGENCY ONLY.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 8038, 8399 ] }
5,523
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
RiyadhAgency
contract RiyadhAgency is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
safeCityTransfer
function safeCityTransfer(address _to, uint256 _amount) internal { uint256 cityBal = city.balanceOf(address(this)); if (_amount > cityBal) { city.transfer(_to, cityBal); } else { city.transfer(_to, _amount); } }
// Safe city transfer function, just in case if rounding error causes pool to not have enough CITYs.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 8508, 8791 ] }
5,524
RiyadhAgency
RiyadhAgency.sol
0x5e65eb881346dfba15419bbf14bfc3927984e9dc
Solidity
RiyadhAgency
contract RiyadhAgency is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
dev
function dev(address _devaddr) public { require(msg.sender == devaddr, "dev: wut?"); devaddr = _devaddr; }
// Update dev address by the previous dev.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://a6496326497b0de5d5b38adbd1cc2dbef988d0badfd0c2478195ea13870bf0c9
{ "func_code_index": [ 8842, 8976 ] }
5,525
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
Ownable
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 { owner = msg.sender; }...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
Ownable
function Ownable() public { owner = msg.sender; }
/** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 261, 321 ] }
5,526
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
Ownable
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 { owner = msg.sender; }...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); 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. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 644, 820 ] }
5,527
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; 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) pub...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
transfer
function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); T...
/** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 268, 659 ] }
5,528
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; 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) pub...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
balanceOf
function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; }
/** * @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. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 865, 977 ] }
5,529
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
StandardToken
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 transf...
/** * @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 */
NatSpecMultiLine
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_...
/** * @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 */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 401, 853 ] }
5,530
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
StandardToken
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 transf...
/** * @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 */
NatSpecMultiLine
approve
function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); 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 * ...
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 1485, 1675 ] }
5,531
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
StandardToken
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 transf...
/** * @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 */
NatSpecMultiLine
allowance
function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; }
/** * @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. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 1999, 2130 ] }
5,532
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
StandardToken
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 transf...
/** * @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 */
NatSpecMultiLine
increaseApproval
function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
/** * @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 _spend...
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 2596, 2860 ] }
5,533
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
StandardToken
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 transf...
/** * @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 */
NatSpecMultiLine
decreaseApproval
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg...
/** * @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 _spend...
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 3331, 3741 ] }
5,534
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
MintableToken
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that ...
/** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */
NatSpecMultiLine
mint
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; }
/** * @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. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 483, 754 ] }
5,535
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
MintableToken
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that ...
/** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */
NatSpecMultiLine
finishMinting
function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; }
/** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 871, 1013 ] }
5,536
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyToken
contract SelfKeyToken is MintableToken { string public constant name = 'SelfKey'; //solhint-disable-line const-name-snakecase string public constant symbol = 'KEY'; //solhint-disable-line const-name-snakecase uint256 public constant decimals = 18; //solhint-disable-line const-name-snakecase uint25...
/** * @title SelfKeyToken * @dev SelfKey Token implementation. */
NatSpecMultiLine
SelfKeyToken
function SelfKeyToken(uint256 _cap) public { cap = _cap; }
/** * @dev Constructor that sets a maximum supply cap. * @param _cap — The maximum supply cap. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 966, 1043 ] }
5,537
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyToken
contract SelfKeyToken is MintableToken { string public constant name = 'SelfKey'; //solhint-disable-line const-name-snakecase string public constant symbol = 'KEY'; //solhint-disable-line const-name-snakecase uint256 public constant decimals = 18; //solhint-disable-line const-name-snakecase uint25...
/** * @title SelfKeyToken * @dev SelfKey Token implementation. */
NatSpecMultiLine
mint
function mint(address _to, uint256 _value) public onlyOwner canMint returns (bool) { require(totalSupply.add(_value) <= cap); return super.mint(_to, _value); }
/** * @dev Overrides MintableToken.mint() for restricting supply under cap * @param _to — The address to receive minted tokens * @param _value — The number of tokens to mint */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 1252, 1439 ] }
5,538
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyToken
contract SelfKeyToken is MintableToken { string public constant name = 'SelfKey'; //solhint-disable-line const-name-snakecase string public constant symbol = 'KEY'; //solhint-disable-line const-name-snakecase uint256 public constant decimals = 18; //solhint-disable-line const-name-snakecase uint25...
/** * @title SelfKeyToken * @dev SelfKey Token implementation. */
NatSpecMultiLine
transfer
function transfer(address _to, uint256 _value) public canTransfer(msg.sender, _value) returns (bool) { return super.transfer(_to, _value); }
/** * @dev Checks modifier and allows transfer if tokens are not locked. * @param _to — The address to receive tokens * @param _value — The number of tokens to send */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 1639, 1812 ] }
5,539
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyToken
contract SelfKeyToken is MintableToken { string public constant name = 'SelfKey'; //solhint-disable-line const-name-snakecase string public constant symbol = 'KEY'; //solhint-disable-line const-name-snakecase uint256 public constant decimals = 18; //solhint-disable-line const-name-snakecase uint25...
/** * @title SelfKeyToken * @dev SelfKey Token implementation. */
NatSpecMultiLine
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public canTransfer(_from, _value) returns (bool) { return super.transferFrom(_from, _to, _value); }
/** * @dev Checks modifier and allows transfer if tokens are not locked. * @param _from — The address to send tokens from * @param _to — The address to receive tokens * @param _value — The number of tokens to send */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 2067, 2265 ] }
5,540
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyToken
contract SelfKeyToken is MintableToken { string public constant name = 'SelfKey'; //solhint-disable-line const-name-snakecase string public constant symbol = 'KEY'; //solhint-disable-line const-name-snakecase uint256 public constant decimals = 18; //solhint-disable-line const-name-snakecase uint25...
/** * @title SelfKeyToken * @dev SelfKey Token implementation. */
NatSpecMultiLine
enableTransfers
function enableTransfers() public onlyOwner { transfersEnabled = true; }
/** * @dev Enables token transfers. * Called when the token sale is successfully finalized */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 2390, 2481 ] }
5,541
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyToken
contract SelfKeyToken is MintableToken { string public constant name = 'SelfKey'; //solhint-disable-line const-name-snakecase string public constant symbol = 'KEY'; //solhint-disable-line const-name-snakecase uint256 public constant decimals = 18; //solhint-disable-line const-name-snakecase uint25...
/** * @title SelfKeyToken * @dev SelfKey Token implementation. */
NatSpecMultiLine
burn
function burn(uint256 _value) public onlyOwner { require(_value > 0); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burned(burner, _value); }
/** * @dev Burns a specific number of tokens. * @param _value — The number of tokens to be burned. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 2606, 2875 ] }
5,542
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
TokenTimelock
contract TokenTimelock { using SafeERC20 for ERC20Basic; // ERC20 basic token contract being held ERC20Basic public token; // beneficiary of tokens after they are released address public beneficiary; // timestamp when token release is enabled uint256 public releaseTime; function TokenTim...
/** * @title TokenTimelock * @dev TokenTimelock is a token holder contract that will allow a * beneficiary to extract the tokens after a given release time */
NatSpecMultiLine
release
function release() public { require(now >= releaseTime); uint256 amount = token.balanceOf(this); require(amount > 0); token.safeTransfer(beneficiary, amount); }
/** * @notice Transfers tokens held by timelock to beneficiary. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 605, 795 ] }
5,543
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
SelfKeyCrowdsale
function SelfKeyCrowdsale( uint64 _startTime, uint64 _endTime, uint256 _goal ) public { require(_endTime > _startTime); // sets contract owner as a verifier isVerifier[msg.sender] = true; token = new SelfKeyToken(TOTAL_SUPPLY_CAP); // mints all possible tokens to the crow...
/** * @dev Crowdsale contract constructor * @param _startTime — Unix timestamp representing the crowdsale start time * @param _endTime — Unix timestamp representing the crowdsale start time * @param _goal — Minimum amount of tokens expected to sell. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 2101, 3913 ] }
5,544
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
function () public payable { buyTokens(msg.sender); }
/** * @dev Fallback function is used to buy tokens. * It's the only entry point since `buyTokens` is internal */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 4057, 4129 ] }
5,545
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
addVerifier
function addVerifier (address _address) public onlyOwner { isVerifier[_address] = true; }
/** * @dev Adds an address to the whitelist of Verifiers * @param _address - address of the verifier */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 4259, 4367 ] }
5,546
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
removeVerifier
function removeVerifier (address _address) public onlyOwner { isVerifier[_address] = false; }
/** * @dev Removes an address from the whitelist of Verifiers * @param _address - address of the verifier to be removed */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 4516, 4628 ] }
5,547
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
setStartTime
function setStartTime (uint64 _startTime) public onlyOwner { require(now < startTime); require(_startTime > now); require(_startTime < endTime); startTime = _startTime; }
/** * @dev Sets a new start date as long as token hasn't started yet * @param _startTime - unix timestamp of the new start time */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 4785, 5003 ] }
5,548
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
setEndTime
function setEndTime (uint64 _endTime) public onlyOwner { require(now < endTime); require(_endTime > now); require(_endTime > startTime); endTime = _endTime; }
/** * @dev Sets a new end date as long as end date hasn't been reached * @param _endTime - unix timestamp of the new end time */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 5158, 5364 ] }
5,549
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
setEthPrice
function setEthPrice(uint256 _ethPrice) public onlyOwner { require(now < startTime); require(_ethPrice > 0); ethPrice = _ethPrice; rate = ethPrice.mul(1000).div(TOKEN_PRICE_THOUSANDTH); }
/** * @dev Updates the ETH/USD conversion rate as long as the public sale hasn't started * @param _ethPrice - Updated conversion rate */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 5527, 5762 ] }
5,550
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
finalize
function finalize() public onlyOwner { require(now > startTime); require(!isFinalized); finalization(); Finalized(); isFinalized = true; }
/** * @dev Must be called after crowdsale ends, to do some extra finalization * work. Calls the contract's finalization function. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 5926, 6123 ] }
5,551
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
claimRefund
function claimRefund(address participant) public { // requires sale to be finalized and goal not reached, require(isFinalized); require(!goalReached()); vault.refund(participant); }
/** * @dev If crowdsale is unsuccessful, a refund can be claimed back */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 6216, 6445 ] }
5,552
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
goalReached
function goalReached() public constant returns (bool) { return totalPurchased >= goal; }
/** * @dev If crowdsale is unsuccessful, participants can claim refunds */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 6540, 6647 ] }
5,553
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
releaseLockFounders1
function releaseLockFounders1() public { foundersTimelock1.release(); }
/** * @dev Release time-locked tokens */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 6708, 6798 ] }
5,554
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
releaseLock
function releaseLock(address participant) public { require(vestedTokens[participant] != 0x0); TokenTimelock timelock = TokenTimelock(vestedTokens[participant]); timelock.release(); }
/** * @dev Release time-locked tokens for any vested address */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 7070, 7291 ] }
5,555
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
verifyKYC
function verifyKYC(address participant) public verifierOnly { kycVerified[participant] = true; VerifiedKYC(participant); }
/** * @dev Verifies KYC for given participant. * This enables token purchases by the participant addres */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 7429, 7581 ] }
5,556
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
addPrecommitment
function addPrecommitment( address beneficiary, uint256 tokensAllocated, bool halfVesting ) public verifierOnly { // requires to be on pre-sale require(now < startTime); // solhint-disable-line not-rely-on-time kycVerified[beneficiary] = true; uint256 tokens = tokensAllocated; ...
/** * @dev Adds an address for pre-sale commitments made off-chain. * @param beneficiary — Address of the already verified participant * @param tokensAllocated — Exact amount of KEY tokens (including decimal places) to allocate * @param halfVesting — determines whether the half the tokens will be time-locked or...
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 7939, 9440 ] }
5,557
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
finalization
function finalization() internal { if (goalReached()) { burnUnsold(); vault.close(); token.enableTransfers(); } else { vault.enableRefunds(); } }
/** * @dev Additional finalization logic. Enables token transfers. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 9530, 9764 ] }
5,558
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
buyTokens
function buyTokens(address participant) internal { require(kycVerified[participant]); require(now >= startTime); require(now < endTime); require(!isFinalized); require(msg.value != 0); // Calculate the token amount to be allocated uint256 weiAmount = msg.value; uint256 tokens =...
/** * @dev Low level token purchase. Only callable internally. Participants MUST be KYC-verified before purchase * @param participant — The address of the token purchaser */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 9966, 11275 ] }
5,559
SelfKeyCrowdsale
SelfKeyCrowdsale.sol
0x8d4b2cffe2dcbbf06eaa5920401db86ca5fb8177
Solidity
SelfKeyCrowdsale
contract SelfKeyCrowdsale is Ownable, CrowdsaleConfig { using SafeMath for uint256; using SafeERC20 for SelfKeyToken; // whitelist of addresses that can perform precommitments and KYC verifications mapping(address => bool) public isVerifier; // Token contract SelfKeyToken public token;...
// solhint-disable-next-line max-states-count
LineComment
burnUnsold
function burnUnsold() internal { // All tokens held by this contract get burned token.burn(token.balanceOf(this)); }
/** * @dev Burn all remaining (unsold) tokens. * This should be called after sale finalization */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff77
{ "func_code_index": [ 11404, 11548 ] }
5,560
DefiCoinToken
DefiCoinToken.sol
0xe932cae1a787e80c8626d01811005cdbbc30edcd
Solidity
DefiCoinToken
contract DefiCoinToken is ERC20 { uint256 public totalSupply; uint public decimals; string public symbol; string public name; mapping (address => mapping (address => uint256)) approach; mapping (address => uint256) holders; //***************************** REVERT IF ETHEREUM SEND ************************ functio...
//***************************** CONTRACT ***************************************
LineComment
function () public { revert(); }
//***************************** REVERT IF ETHEREUM SEND ************************
LineComment
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://32382a95e4a922fc13a06c97a2b92083e8b84af26f2a7db0202a61ad586208d7
{ "func_code_index": [ 313, 348 ] }
5,561
DefiCoinToken
DefiCoinToken.sol
0xe932cae1a787e80c8626d01811005cdbbc30edcd
Solidity
DefiCoinToken
contract DefiCoinToken is ERC20 { uint256 public totalSupply; uint public decimals; string public symbol; string public name; mapping (address => mapping (address => uint256)) approach; mapping (address => uint256) holders; //***************************** REVERT IF ETHEREUM SEND ************************ functio...
//***************************** CONTRACT ***************************************
LineComment
balanceOf
function balanceOf(address _own) public view returns (uint256) { return holders[_own]; }
//***************************** CHECK BALANCE **********************************
LineComment
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://32382a95e4a922fc13a06c97a2b92083e8b84af26f2a7db0202a61ad586208d7
{ "func_code_index": [ 431, 523 ] }
5,562
DefiCoinToken
DefiCoinToken.sol
0xe932cae1a787e80c8626d01811005cdbbc30edcd
Solidity
DefiCoinToken
contract DefiCoinToken is ERC20 { uint256 public totalSupply; uint public decimals; string public symbol; string public name; mapping (address => mapping (address => uint256)) approach; mapping (address => uint256) holders; //***************************** REVERT IF ETHEREUM SEND ************************ functio...
//***************************** CONTRACT ***************************************
LineComment
transfer
function transfer(address _to, uint256 _val) public returns (bool) { require(holders[msg.sender] >= _val); require(msg.sender != _to); assert(_val <= holders[msg.sender]); holders[msg.sender] = holders[msg.sender] - _val; holders[_to] = holders[_to] + _val; assert(holders[_to] >= _val); emit Transfer(msg.sender...
//***************************** TRANSFER TOKENS FROM YOUR ACCOUNT **************
LineComment
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://32382a95e4a922fc13a06c97a2b92083e8b84af26f2a7db0202a61ad586208d7
{ "func_code_index": [ 606, 957 ] }
5,563
DefiCoinToken
DefiCoinToken.sol
0xe932cae1a787e80c8626d01811005cdbbc30edcd
Solidity
DefiCoinToken
contract DefiCoinToken is ERC20 { uint256 public totalSupply; uint public decimals; string public symbol; string public name; mapping (address => mapping (address => uint256)) approach; mapping (address => uint256) holders; //***************************** REVERT IF ETHEREUM SEND ************************ functio...
//***************************** CONTRACT ***************************************
LineComment
transferFrom
function transferFrom(address _from, address _to, uint256 _val) public returns (bool) { require(holders[_from] >= _val); require(approach[_from][msg.sender] >= _val); assert(_val <= holders[_from]); holders[_from] = holders[_from] - _val; assert(_val <= approach[_from][msg.sender]); approach[_from][msg.sender] =...
//**************************** TRANSFER TOKENS FROM ANOTHER ACCOUNT ************
LineComment
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://32382a95e4a922fc13a06c97a2b92083e8b84af26f2a7db0202a61ad586208d7
{ "func_code_index": [ 1040, 1516 ] }
5,564
DefiCoinToken
DefiCoinToken.sol
0xe932cae1a787e80c8626d01811005cdbbc30edcd
Solidity
DefiCoinToken
contract DefiCoinToken is ERC20 { uint256 public totalSupply; uint public decimals; string public symbol; string public name; mapping (address => mapping (address => uint256)) approach; mapping (address => uint256) holders; //***************************** REVERT IF ETHEREUM SEND ************************ functio...
//***************************** CONTRACT ***************************************
LineComment
approve
function approve(address _spender, uint256 _val) public returns (bool) { require(holders[msg.sender] >= _val); approach[msg.sender][_spender] = _val; emit Approval(msg.sender, _spender, _val); return true; }
//***************************** APPROVE TOKENS TO SEND *************************
LineComment
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://32382a95e4a922fc13a06c97a2b92083e8b84af26f2a7db0202a61ad586208d7
{ "func_code_index": [ 1599, 1813 ] }
5,565
DefiCoinToken
DefiCoinToken.sol
0xe932cae1a787e80c8626d01811005cdbbc30edcd
Solidity
DefiCoinToken
contract DefiCoinToken is ERC20 { uint256 public totalSupply; uint public decimals; string public symbol; string public name; mapping (address => mapping (address => uint256)) approach; mapping (address => uint256) holders; //***************************** REVERT IF ETHEREUM SEND ************************ functio...
//***************************** CONTRACT ***************************************
LineComment
allowance
function allowance(address _owner, address _spender) public view returns (uint256) { return approach[_owner][_spender]; }
//***************************** CHECK APPROVE **********************************
LineComment
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://32382a95e4a922fc13a06c97a2b92083e8b84af26f2a7db0202a61ad586208d7
{ "func_code_index": [ 1896, 2021 ] }
5,566
Token
Token.sol
0x00c85c226a7899ae3c87ad2e8684d352dc83f180
Solidity
Token
contract Token { /* Public variables of the token */ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; /* This generates a public event on the blockchain ...
function () { revert(); // Prevents accidental sending of ether }
/* This unnamed function is called whenever someone tries to send ether to it */
Comment
v0.4.13+commit.fb4cb1a
bzzr://e59a5c0abb3696f699407f672571120209b7d2ff2612d98fda68372b64de45e9
{ "func_code_index": [ 1347, 1422 ] }
5,567
ChillyPenguins
@openzeppelin/contracts/access/Ownable.sol
0x65054198daf01505d1896f08b04033931cb9a045
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); ...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
owner
function owner() public view virtual returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://4833852de9a972c267c596d37354757c75adae8b504aaaa813ec5b955eb570e5
{ "func_code_index": [ 399, 491 ] }
5,568
ChillyPenguins
@openzeppelin/contracts/access/Ownable.sol
0x65054198daf01505d1896f08b04033931cb9a045
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); ...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
renounceOwnership
function renounceOwnership() public virtual onlyOwner { _setOwner(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 owner. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://4833852de9a972c267c596d37354757c75adae8b504aaaa813ec5b955eb570e5
{ "func_code_index": [ 1050, 1149 ] }
5,569
ChillyPenguins
@openzeppelin/contracts/access/Ownable.sol
0x65054198daf01505d1896f08b04033931cb9a045
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); ...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); }
/** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://4833852de9a972c267c596d37354757c75adae8b504aaaa813ec5b955eb570e5
{ "func_code_index": [ 1299, 1496 ] }
5,570
Genesis_Voting
Genesis_Voting.sol
0x8eca4809d16dad560c0685ceeecc042f6ffbd3e4
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSend...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
owner
function owner() public view virtual returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.8.1+commit.df193b15
MIT
ipfs://02021a45cce72f6e544aadac6319150725f4f1b67eacf824ff0905ecd61f5e34
{ "func_code_index": [ 497, 589 ] }
5,571
Genesis_Voting
Genesis_Voting.sol
0x8eca4809d16dad560c0685ceeecc042f6ffbd3e4
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSend...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
renounceOwnership
function renounceOwnership() public virtual onlyOwner { 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 owner. */
NatSpecMultiLine
v0.8.1+commit.df193b15
MIT
ipfs://02021a45cce72f6e544aadac6319150725f4f1b67eacf824ff0905ecd61f5e34
{ "func_code_index": [ 1148, 1301 ] }
5,572
Genesis_Voting
Genesis_Voting.sol
0x8eca4809d16dad560c0685ceeecc042f6ffbd3e4
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSend...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public virtual onlyOwner { 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. */
NatSpecMultiLine
v0.8.1+commit.df193b15
MIT
ipfs://02021a45cce72f6e544aadac6319150725f4f1b67eacf824ff0905ecd61f5e34
{ "func_code_index": [ 1451, 1700 ] }
5,573
Genesis_Voting
Genesis_Voting.sol
0x8eca4809d16dad560c0685ceeecc042f6ffbd3e4
Solidity
IERC20
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 Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.8.1+commit.df193b15
MIT
ipfs://02021a45cce72f6e544aadac6319150725f4f1b67eacf824ff0905ecd61f5e34
{ "func_code_index": [ 94, 154 ] }
5,574
Genesis_Voting
Genesis_Voting.sol
0x8eca4809d16dad560c0685ceeecc042f6ffbd3e4
Solidity
IERC20
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 Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.8.1+commit.df193b15
MIT
ipfs://02021a45cce72f6e544aadac6319150725f4f1b67eacf824ff0905ecd61f5e34
{ "func_code_index": [ 237, 310 ] }
5,575
Genesis_Voting
Genesis_Voting.sol
0x8eca4809d16dad560c0685ceeecc042f6ffbd3e4
Solidity
IERC20
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 Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.8.1+commit.df193b15
MIT
ipfs://02021a45cce72f6e544aadac6319150725f4f1b67eacf824ff0905ecd61f5e34
{ "func_code_index": [ 534, 616 ] }
5,576
Genesis_Voting
Genesis_Voting.sol
0x8eca4809d16dad560c0685ceeecc042f6ffbd3e4
Solidity
IERC20
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 Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
allowance
function allowance(address owner, address spender) external view returns (uint256);
/** * @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. */
NatSpecMultiLine
v0.8.1+commit.df193b15
MIT
ipfs://02021a45cce72f6e544aadac6319150725f4f1b67eacf824ff0905ecd61f5e34
{ "func_code_index": [ 895, 983 ] }
5,577
Genesis_Voting
Genesis_Voting.sol
0x8eca4809d16dad560c0685ceeecc042f6ffbd3e4
Solidity
IERC20
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 Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) external returns (bool);
/** * @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 ...
NatSpecMultiLine
v0.8.1+commit.df193b15
MIT
ipfs://02021a45cce72f6e544aadac6319150725f4f1b67eacf824ff0905ecd61f5e34
{ "func_code_index": [ 1647, 1726 ] }
5,578
Genesis_Voting
Genesis_Voting.sol
0x8eca4809d16dad560c0685ceeecc042f6ffbd3e4
Solidity
IERC20
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 Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, 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. */
NatSpecMultiLine
v0.8.1+commit.df193b15
MIT
ipfs://02021a45cce72f6e544aadac6319150725f4f1b67eacf824ff0905ecd61f5e34
{ "func_code_index": [ 2039, 2141 ] }
5,579
TokenERC20
TokenERC20.sol
0xeac224ec129b203bd9067db6e3df1646fd4e640a
Solidity
TokenERC20
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 (addre...
_transfer
function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != address(0x0)); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanc...
/** * Internal transfer, only can be called by this contract */
NatSpecMultiLine
v0.5.1+commit.c8a2cb62
GNU GPLv3
bzzr://5370cc40a45c16341193a25ef627624af393a02b53482ed8db4811018656360d
{ "func_code_index": [ 1661, 2517 ] }
5,580
TokenERC20
TokenERC20.sol
0xeac224ec129b203bd9067db6e3df1646fd4e640a
Solidity
TokenERC20
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 (addre...
transfer
function transfer(address _to, uint256 _value) public returns (bool success) { _transfer(msg.sender, _to, _value); return true; }
/** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */
NatSpecMultiLine
v0.5.1+commit.c8a2cb62
GNU GPLv3
bzzr://5370cc40a45c16341193a25ef627624af393a02b53482ed8db4811018656360d
{ "func_code_index": [ 2723, 2880 ] }
5,581
TokenERC20
TokenERC20.sol
0xeac224ec129b203bd9067db6e3df1646fd4e640a
Solidity
TokenERC20
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 (addre...
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; }
/** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */
NatSpecMultiLine
v0.5.1+commit.c8a2cb62
GNU GPLv3
bzzr://5370cc40a45c16341193a25ef627624af393a02b53482ed8db4811018656360d
{ "func_code_index": [ 3155, 3456 ] }
5,582
TokenERC20
TokenERC20.sol
0xeac224ec129b203bd9067db6e3df1646fd4e640a
Solidity
TokenERC20
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 (addre...
approve
function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; }
/** * 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 */
NatSpecMultiLine
v0.5.1+commit.c8a2cb62
GNU GPLv3
bzzr://5370cc40a45c16341193a25ef627624af393a02b53482ed8db4811018656360d
{ "func_code_index": [ 3720, 3950 ] }
5,583
TokenERC20
TokenERC20.sol
0xeac224ec129b203bd9067db6e3df1646fd4e640a
Solidity
TokenERC20
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 (addre...
approveAndCall
function approveAndCall(address _spender, uint256 _value, bytes memory _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, address(this), _extraData); return true...
/** * 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 s...
NatSpecMultiLine
v0.5.1+commit.c8a2cb62
GNU GPLv3
bzzr://5370cc40a45c16341193a25ef627624af393a02b53482ed8db4811018656360d
{ "func_code_index": [ 4344, 4712 ] }
5,584
TokenERC20
TokenERC20.sol
0xeac224ec129b203bd9067db6e3df1646fd4e640a
Solidity
TokenERC20
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 (addre...
burn
function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender,...
/** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */
NatSpecMultiLine
v0.5.1+commit.c8a2cb62
GNU GPLv3
bzzr://5370cc40a45c16341193a25ef627624af393a02b53482ed8db4811018656360d
{ "func_code_index": [ 4882, 5261 ] }
5,585
TokenERC20
TokenERC20.sol
0xeac224ec129b203bd9067db6e3df1646fd4e640a
Solidity
TokenERC20
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 (addre...
burnFrom
function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Sub...
/** * 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 */
NatSpecMultiLine
v0.5.1+commit.c8a2cb62
GNU GPLv3
bzzr://5370cc40a45c16341193a25ef627624af393a02b53482ed8db4811018656360d
{ "func_code_index": [ 5519, 6135 ] }
5,586
TokenERC20
TokenERC20.sol
0xeac224ec129b203bd9067db6e3df1646fd4e640a
Solidity
MyAdvancedToken
contract MyAdvancedToken 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); /* Initi...
/******************************************/
NatSpecMultiLine
_transfer
function _transfer(address _from, address _to, uint _value) internal { require (_to != address(0x0)); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value ...
/* Internal transfer, only can be called by this contract */
Comment
v0.5.1+commit.c8a2cb62
GNU GPLv3
bzzr://5370cc40a45c16341193a25ef627624af393a02b53482ed8db4811018656360d
{ "func_code_index": [ 652, 1467 ] }
5,587
TokenERC20
TokenERC20.sol
0xeac224ec129b203bd9067db6e3df1646fd4e640a
Solidity
MyAdvancedToken
contract MyAdvancedToken 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); /* Initi...
/******************************************/
NatSpecMultiLine
mintToken
function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; emit Transfer(address(0), address(this), mintedAmount); emit Transfer(address(this), target, mintedAmount); }
/// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive
NatSpecSingleLine
v0.5.1+commit.c8a2cb62
GNU GPLv3
bzzr://5370cc40a45c16341193a25ef627624af393a02b53482ed8db4811018656360d
{ "func_code_index": [ 1659, 1954 ] }
5,588
TokenERC20
TokenERC20.sol
0xeac224ec129b203bd9067db6e3df1646fd4e640a
Solidity
MyAdvancedToken
contract MyAdvancedToken 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); /* Initi...
/******************************************/
NatSpecMultiLine
freezeAccount
function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; emit FrozenFunds(target, freeze); }
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not
NatSpecSingleLine
v0.5.1+commit.c8a2cb62
GNU GPLv3
bzzr://5370cc40a45c16341193a25ef627624af393a02b53482ed8db4811018656360d
{ "func_code_index": [ 2135, 2301 ] }
5,589
TokenERC20
TokenERC20.sol
0xeac224ec129b203bd9067db6e3df1646fd4e640a
Solidity
MyAdvancedToken
contract MyAdvancedToken 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); /* Initi...
/******************************************/
NatSpecMultiLine
setPrices
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; }
/// @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
NatSpecSingleLine
v0.5.1+commit.c8a2cb62
GNU GPLv3
bzzr://5370cc40a45c16341193a25ef627624af393a02b53482ed8db4811018656360d
{ "func_code_index": [ 2544, 2704 ] }
5,590
TokenERC20
TokenERC20.sol
0xeac224ec129b203bd9067db6e3df1646fd4e640a
Solidity
MyAdvancedToken
contract MyAdvancedToken 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); /* Initi...
/******************************************/
NatSpecMultiLine
buy
function buy() payable public { uint amount = msg.value / buyPrice; // calculates the amount _transfer(address(this), msg.sender, amount); // makes the transfers }
/// @notice Buy tokens from contract by sending ether
NatSpecSingleLine
v0.5.1+commit.c8a2cb62
GNU GPLv3
bzzr://5370cc40a45c16341193a25ef627624af393a02b53482ed8db4811018656360d
{ "func_code_index": [ 2766, 2979 ] }
5,591
TokenERC20
TokenERC20.sol
0xeac224ec129b203bd9067db6e3df1646fd4e640a
Solidity
MyAdvancedToken
contract MyAdvancedToken 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); /* Initi...
/******************************************/
NatSpecMultiLine
sell
function sell(uint256 amount) public { address myAddress = address(this); require(myAddress.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, address(this), amount); // makes the transfers msg.sender.transfer(amount * sellPrice); ...
/// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold
NatSpecSingleLine
v0.5.1+commit.c8a2cb62
GNU GPLv3
bzzr://5370cc40a45c16341193a25ef627624af393a02b53482ed8db4811018656360d
{ "func_code_index": [ 3083, 3521 ] }
5,592
FlashLiquidator
@uniswap/v3-periphery/contracts/interfaces/IPeripheryImmutableState.sol
0x23d85060f87218bb276afe55a26bfd3b5f59914e
Solidity
IPeripheryImmutableState
interface IPeripheryImmutableState { /// @return Returns the address of the Uniswap V3 factory function factory() external view returns (address); /// @return Returns the address of WETH9 function WETH9() external view returns (address); }
/// @title Immutable state /// @notice Functions that return immutable state of the router
NatSpecSingleLine
factory
function factory() external view returns (address);
/// @return Returns the address of the Uniswap V3 factory
NatSpecSingleLine
v0.8.6+commit.11564f7e
{ "func_code_index": [ 99, 154 ] }
5,593
FlashLiquidator
@uniswap/v3-periphery/contracts/interfaces/IPeripheryImmutableState.sol
0x23d85060f87218bb276afe55a26bfd3b5f59914e
Solidity
IPeripheryImmutableState
interface IPeripheryImmutableState { /// @return Returns the address of the Uniswap V3 factory function factory() external view returns (address); /// @return Returns the address of WETH9 function WETH9() external view returns (address); }
/// @title Immutable state /// @notice Functions that return immutable state of the router
NatSpecSingleLine
WETH9
function WETH9() external view returns (address);
/// @return Returns the address of WETH9
NatSpecSingleLine
v0.8.6+commit.11564f7e
{ "func_code_index": [ 201, 254 ] }
5,594
FlashLiquidator
@yield-protocol/vault-interfaces/IWitch.sol
0x23d85060f87218bb276afe55a26bfd3b5f59914e
Solidity
IWitch
interface IWitch { /// @dev Link to the Cauldron in the Yield Protocol function cauldron() external returns (ICauldron); /// @dev Link to the Ladle in the Yield Protocol function ladle() external returns (ILadle); /// @dev Vaults up for liquidation function auctions(bytes12 vaultId) external r...
cauldron
function cauldron() external returns (ICauldron);
/// @dev Link to the Cauldron in the Yield Protocol
NatSpecSingleLine
v0.8.6+commit.11564f7e
{ "func_code_index": [ 75, 128 ] }
5,595
FlashLiquidator
@yield-protocol/vault-interfaces/IWitch.sol
0x23d85060f87218bb276afe55a26bfd3b5f59914e
Solidity
IWitch
interface IWitch { /// @dev Link to the Cauldron in the Yield Protocol function cauldron() external returns (ICauldron); /// @dev Link to the Ladle in the Yield Protocol function ladle() external returns (ILadle); /// @dev Vaults up for liquidation function auctions(bytes12 vaultId) external r...
ladle
function ladle() external returns (ILadle);
/// @dev Link to the Ladle in the Yield Protocol
NatSpecSingleLine
v0.8.6+commit.11564f7e
{ "func_code_index": [ 183, 230 ] }
5,596
FlashLiquidator
@yield-protocol/vault-interfaces/IWitch.sol
0x23d85060f87218bb276afe55a26bfd3b5f59914e
Solidity
IWitch
interface IWitch { /// @dev Link to the Cauldron in the Yield Protocol function cauldron() external returns (ICauldron); /// @dev Link to the Ladle in the Yield Protocol function ladle() external returns (ILadle); /// @dev Vaults up for liquidation function auctions(bytes12 vaultId) external r...
auctions
function auctions(bytes12 vaultId) external returns (address owner, uint32 start);
/// @dev Vaults up for liquidation
NatSpecSingleLine
v0.8.6+commit.11564f7e
{ "func_code_index": [ 271, 357 ] }
5,597
FlashLiquidator
@yield-protocol/vault-interfaces/IWitch.sol
0x23d85060f87218bb276afe55a26bfd3b5f59914e
Solidity
IWitch
interface IWitch { /// @dev Link to the Cauldron in the Yield Protocol function cauldron() external returns (ICauldron); /// @dev Link to the Ladle in the Yield Protocol function ladle() external returns (ILadle); /// @dev Vaults up for liquidation function auctions(bytes12 vaultId) external r...
ilks
function ilks(bytes6 ilkId) external returns (uint32 duration, uint64 initialOffer);
/// @dev Auction parameters per ilk
NatSpecSingleLine
v0.8.6+commit.11564f7e
{ "func_code_index": [ 399, 487 ] }
5,598
FlashLiquidator
@yield-protocol/vault-interfaces/IWitch.sol
0x23d85060f87218bb276afe55a26bfd3b5f59914e
Solidity
IWitch
interface IWitch { /// @dev Link to the Cauldron in the Yield Protocol function cauldron() external returns (ICauldron); /// @dev Link to the Ladle in the Yield Protocol function ladle() external returns (ILadle); /// @dev Vaults up for liquidation function auctions(bytes12 vaultId) external r...
payAll
function payAll(bytes12 vaultId, uint128 min) external returns (uint256 ink);
/// @dev Pay all debt from a vault in liquidation, getting at least `min` collateral.
NatSpecSingleLine
v0.8.6+commit.11564f7e
{ "func_code_index": [ 579, 660 ] }
5,599