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
AddressMapper
contracts/mapping/AddressMapper.sol
0x8141304775e86471ee16a17e5b3bae6456019b03
Solidity
AddressMapper
contract AddressMapper { // @notice Contract that defines access controls for the CUDO ecosystem CudosAccessControls public accessControls; // @notice defines whether a user can set their mapping bool public userActionsPaused; // @notice defines mapping between ETH address and CUDO address mapping(address => string) public cudosAddress; event UserActionsPausedToggled(bool isPaused); event AddressMapped(address indexed ethAddress, string cudosAddress); modifier onlyUnpaused() { require(userActionsPaused == false, "Paused"); _; } constructor(CudosAccessControls _accessControls) { accessControls = _accessControls; } // Set mapping between ETH address and CUDOS address function setAddress(string memory _cudoAddress) external onlyUnpaused { cudosAddress[msg.sender] = _cudoAddress; emit AddressMapped(msg.sender, _cudoAddress); } // ***** // Admin // ***** function updateUserActionsPaused(bool _isPaused) external { require(accessControls.hasAdminRole(msg.sender), "Only admin"); userActionsPaused = _isPaused; emit UserActionsPausedToggled(_isPaused); } }
setAddress
function setAddress(string memory _cudoAddress) external onlyUnpaused { cudosAddress[msg.sender] = _cudoAddress; emit AddressMapped(msg.sender, _cudoAddress); }
// Set mapping between ETH address and CUDOS address
LineComment
v0.8.0+commit.c7dfd78e
{ "func_code_index": [ 757, 942 ] }
3,400
AddressMapper
contracts/mapping/AddressMapper.sol
0x8141304775e86471ee16a17e5b3bae6456019b03
Solidity
AddressMapper
contract AddressMapper { // @notice Contract that defines access controls for the CUDO ecosystem CudosAccessControls public accessControls; // @notice defines whether a user can set their mapping bool public userActionsPaused; // @notice defines mapping between ETH address and CUDO address mapping(address => string) public cudosAddress; event UserActionsPausedToggled(bool isPaused); event AddressMapped(address indexed ethAddress, string cudosAddress); modifier onlyUnpaused() { require(userActionsPaused == false, "Paused"); _; } constructor(CudosAccessControls _accessControls) { accessControls = _accessControls; } // Set mapping between ETH address and CUDOS address function setAddress(string memory _cudoAddress) external onlyUnpaused { cudosAddress[msg.sender] = _cudoAddress; emit AddressMapped(msg.sender, _cudoAddress); } // ***** // Admin // ***** function updateUserActionsPaused(bool _isPaused) external { require(accessControls.hasAdminRole(msg.sender), "Only admin"); userActionsPaused = _isPaused; emit UserActionsPausedToggled(_isPaused); } }
updateUserActionsPaused
function updateUserActionsPaused(bool _isPaused) external { require(accessControls.hasAdminRole(msg.sender), "Only admin"); userActionsPaused = _isPaused; emit UserActionsPausedToggled(_isPaused); }
// ***** // Admin // *****
LineComment
v0.8.0+commit.c7dfd78e
{ "func_code_index": [ 984, 1216 ] }
3,401
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. **/ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. **/ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). **/ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. **/ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } }
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; }
/** * @dev Multiplies two numbers, throws on overflow. **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 96, 303 ] }
3,402
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. **/ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. **/ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). **/ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. **/ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } }
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; }
/** * @dev Integer division of two numbers, truncating the quotient. **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 400, 700 ] }
3,403
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. **/ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. **/ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). **/ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. **/ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } }
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
/** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 827, 955 ] }
3,404
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. **/ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. **/ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). **/ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. **/ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } }
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; }
/** * @dev Adds two numbers, throws on overflow. **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 1032, 1178 ] }
3,405
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
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. **/ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. **/ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. **/ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } }
/** * @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)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 665, 856 ] }
3,406
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence **/ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. **/ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. **/ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } }
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. **/
NatSpecMultiLine
totalSupply
function totalSupply() public view returns (uint256) { return totalSupply_; }
/** * @dev total number of tokens in existence **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 214, 310 ] }
3,407
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence **/ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. **/ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. **/ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } }
/** * @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]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; }
/** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 487, 855 ] }
3,408
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence **/ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. **/ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. **/ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } }
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. **/
NatSpecMultiLine
balanceOf
function balanceOf(address _owner) public view returns (uint256) { 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.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 1080, 1192 ] }
3,409
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
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 transfer to * @param _value uint256 the amount of tokens to be transferred **/ 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[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _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 * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. **/ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. **/ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. **/ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. **/ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
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[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; }
/** * @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.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 410, 917 ] }
3,410
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
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 transfer to * @param _value uint256 the amount of tokens to be transferred **/ 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[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _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 * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. **/ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. **/ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. **/ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. **/ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
approve
function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit 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 * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 1574, 1785 ] }
3,411
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
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 transfer to * @param _value uint256 the amount of tokens to be transferred **/ 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[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _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 * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. **/ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. **/ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. **/ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. **/ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
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.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 2126, 2265 ] }
3,412
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
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 transfer to * @param _value uint256 the amount of tokens to be transferred **/ 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[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _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 * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. **/ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. **/ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. **/ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. **/ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
increaseApproval
function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit 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 _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 2756, 3041 ] }
3,413
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
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 transfer to * @param _value uint256 the amount of tokens to be transferred **/ 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[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _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 * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. **/ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. **/ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. **/ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. **/ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
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); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
/** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 3537, 3992 ] }
3,414
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
Solidity
CrowdsaleToken
contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ constructor() public { currentStage = Stages.none; balances[owner] = balances[owner].add(tokenReserve); totalSupply_ = totalSupply_.add(tokenReserve); remainingTokens = cap; emit Transfer(address(this), owner, tokenReserve); } /** * @dev fallback function to send ether to for Crowd sale **/ function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 weiAmount = msg.value; // Calculate tokens to sell uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; if(tokensSold.add(tokens) > cap){ uint256 newTokens = cap.sub(tokensSold); uint256 newWei = newTokens.div(basePrice).mul(1 ether); returnWei = weiAmount.sub(newWei); weiAmount = newWei; tokens = newTokens; } tokensSold = tokensSold.add(tokens); // Increment raised amount remainingTokens = cap.sub(tokensSold); if(returnWei > 0){ msg.sender.transfer(returnWei); emit Transfer(address(this), msg.sender, returnWei); } balances[msg.sender] = balances[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); totalSupply_ = totalSupply_.add(tokens); owner.transfer(weiAmount);// Send money to owner } /** * @dev startIco starts the public ICO **/ function startIco() public onlyOwner { require(currentStage != Stages.icoEnd); currentStage = Stages.icoStart; } /** * @dev endIco closes down the ICO **/ function endIco() internal { currentStage = Stages.icoEnd; // Transfer any remaining tokens if(remainingTokens > 0) balances[owner] = balances[owner].add(remainingTokens); // transfer any remaining ETH balance in the contract to the owner owner.transfer(address(this).balance); } /** * @dev finalizeIco closes down the ICO and sets needed varriables **/ function finalizeIco() public onlyOwner { require(currentStage != Stages.icoEnd); endIco(); } }
/** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/
NatSpecMultiLine
function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 weiAmount = msg.value; // Calculate tokens to sell uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; if(tokensSold.add(tokens) > cap){ uint256 newTokens = cap.sub(tokensSold); uint256 newWei = newTokens.div(basePrice).mul(1 ether); returnWei = weiAmount.sub(newWei); weiAmount = newWei; tokens = newTokens; } tokensSold = tokensSold.add(tokens); // Increment raised amount remainingTokens = cap.sub(tokensSold); if(returnWei > 0){ msg.sender.transfer(returnWei); emit Transfer(address(this), msg.sender, returnWei); } balances[msg.sender] = balances[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); totalSupply_ = totalSupply_.add(tokens); owner.transfer(weiAmount);// Send money to owner }
/** * @dev fallback function to send ether to for Crowd sale **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 678, 1851 ] }
3,415
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
Solidity
CrowdsaleToken
contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ constructor() public { currentStage = Stages.none; balances[owner] = balances[owner].add(tokenReserve); totalSupply_ = totalSupply_.add(tokenReserve); remainingTokens = cap; emit Transfer(address(this), owner, tokenReserve); } /** * @dev fallback function to send ether to for Crowd sale **/ function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 weiAmount = msg.value; // Calculate tokens to sell uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; if(tokensSold.add(tokens) > cap){ uint256 newTokens = cap.sub(tokensSold); uint256 newWei = newTokens.div(basePrice).mul(1 ether); returnWei = weiAmount.sub(newWei); weiAmount = newWei; tokens = newTokens; } tokensSold = tokensSold.add(tokens); // Increment raised amount remainingTokens = cap.sub(tokensSold); if(returnWei > 0){ msg.sender.transfer(returnWei); emit Transfer(address(this), msg.sender, returnWei); } balances[msg.sender] = balances[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); totalSupply_ = totalSupply_.add(tokens); owner.transfer(weiAmount);// Send money to owner } /** * @dev startIco starts the public ICO **/ function startIco() public onlyOwner { require(currentStage != Stages.icoEnd); currentStage = Stages.icoStart; } /** * @dev endIco closes down the ICO **/ function endIco() internal { currentStage = Stages.icoEnd; // Transfer any remaining tokens if(remainingTokens > 0) balances[owner] = balances[owner].add(remainingTokens); // transfer any remaining ETH balance in the contract to the owner owner.transfer(address(this).balance); } /** * @dev finalizeIco closes down the ICO and sets needed varriables **/ function finalizeIco() public onlyOwner { require(currentStage != Stages.icoEnd); endIco(); } }
/** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/
NatSpecMultiLine
startIco
function startIco() public onlyOwner { require(currentStage != Stages.icoEnd); currentStage = Stages.icoStart; }
/** * @dev startIco starts the public ICO **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 1911, 2051 ] }
3,416
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
Solidity
CrowdsaleToken
contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ constructor() public { currentStage = Stages.none; balances[owner] = balances[owner].add(tokenReserve); totalSupply_ = totalSupply_.add(tokenReserve); remainingTokens = cap; emit Transfer(address(this), owner, tokenReserve); } /** * @dev fallback function to send ether to for Crowd sale **/ function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 weiAmount = msg.value; // Calculate tokens to sell uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; if(tokensSold.add(tokens) > cap){ uint256 newTokens = cap.sub(tokensSold); uint256 newWei = newTokens.div(basePrice).mul(1 ether); returnWei = weiAmount.sub(newWei); weiAmount = newWei; tokens = newTokens; } tokensSold = tokensSold.add(tokens); // Increment raised amount remainingTokens = cap.sub(tokensSold); if(returnWei > 0){ msg.sender.transfer(returnWei); emit Transfer(address(this), msg.sender, returnWei); } balances[msg.sender] = balances[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); totalSupply_ = totalSupply_.add(tokens); owner.transfer(weiAmount);// Send money to owner } /** * @dev startIco starts the public ICO **/ function startIco() public onlyOwner { require(currentStage != Stages.icoEnd); currentStage = Stages.icoStart; } /** * @dev endIco closes down the ICO **/ function endIco() internal { currentStage = Stages.icoEnd; // Transfer any remaining tokens if(remainingTokens > 0) balances[owner] = balances[owner].add(remainingTokens); // transfer any remaining ETH balance in the contract to the owner owner.transfer(address(this).balance); } /** * @dev finalizeIco closes down the ICO and sets needed varriables **/ function finalizeIco() public onlyOwner { require(currentStage != Stages.icoEnd); endIco(); } }
/** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/
NatSpecMultiLine
endIco
function endIco() internal { currentStage = Stages.icoEnd; // Transfer any remaining tokens if(remainingTokens > 0) balances[owner] = balances[owner].add(remainingTokens); // transfer any remaining ETH balance in the contract to the owner owner.transfer(address(this).balance); }
/** * @dev endIco closes down the ICO **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 2108, 2456 ] }
3,417
XPlusToken
XPlusToken.sol
0x941a0dded012adc9359cca55240b8e0b0ebbbcad
Solidity
CrowdsaleToken
contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ constructor() public { currentStage = Stages.none; balances[owner] = balances[owner].add(tokenReserve); totalSupply_ = totalSupply_.add(tokenReserve); remainingTokens = cap; emit Transfer(address(this), owner, tokenReserve); } /** * @dev fallback function to send ether to for Crowd sale **/ function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 weiAmount = msg.value; // Calculate tokens to sell uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; if(tokensSold.add(tokens) > cap){ uint256 newTokens = cap.sub(tokensSold); uint256 newWei = newTokens.div(basePrice).mul(1 ether); returnWei = weiAmount.sub(newWei); weiAmount = newWei; tokens = newTokens; } tokensSold = tokensSold.add(tokens); // Increment raised amount remainingTokens = cap.sub(tokensSold); if(returnWei > 0){ msg.sender.transfer(returnWei); emit Transfer(address(this), msg.sender, returnWei); } balances[msg.sender] = balances[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); totalSupply_ = totalSupply_.add(tokens); owner.transfer(weiAmount);// Send money to owner } /** * @dev startIco starts the public ICO **/ function startIco() public onlyOwner { require(currentStage != Stages.icoEnd); currentStage = Stages.icoStart; } /** * @dev endIco closes down the ICO **/ function endIco() internal { currentStage = Stages.icoEnd; // Transfer any remaining tokens if(remainingTokens > 0) balances[owner] = balances[owner].add(remainingTokens); // transfer any remaining ETH balance in the contract to the owner owner.transfer(address(this).balance); } /** * @dev finalizeIco closes down the ICO and sets needed varriables **/ function finalizeIco() public onlyOwner { require(currentStage != Stages.icoEnd); endIco(); } }
/** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/
NatSpecMultiLine
finalizeIco
function finalizeIco() public onlyOwner { require(currentStage != Stages.icoEnd); endIco(); }
/** * @dev finalizeIco closes down the ICO and sets needed varriables **/
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://1aa777e45ce48f7384d03bfe377a9c93c455ed24860896a5fb6faeec7218ae9f
{ "func_code_index": [ 2544, 2665 ] }
3,418
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } }
/**xxp 校验防止溢出情况 * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; }
/** * @dev Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 89, 518 ] }
3,419
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } }
/**xxp 校验防止溢出情况 * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; }
/** * @dev Integer division of two numbers, truncating the quotient. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 602, 902 ] }
3,420
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } }
/**xxp 校验防止溢出情况 * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
/** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 1016, 1144 ] }
3,421
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } }
/**xxp 校验防止溢出情况 * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; }
/** * @dev Adds two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 1208, 1354 ] }
3,422
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
Ownable
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } }
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
renounceOwnership
function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); }
/** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 851, 980 ] }
3,423
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
Ownable
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } }
/** * @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 { _transferOwnership(_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.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 1145, 1261 ] }
3,424
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
Ownable
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } }
/** * @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) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; }
/** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 1399, 1593 ] }
3,425
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
StandardToken
contract StandardToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
/** * @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
totalSupply
function totalSupply() public view returns (uint256) { return totalSupply_; }
/** * @dev Total number of tokens in existence */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 216, 312 ] }
3,426
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
StandardToken
contract StandardToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
/** * @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
transfer
function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; }
/** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 480, 840 ] }
3,427
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
StandardToken
contract StandardToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
/** * @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
balanceOf
function balanceOf(address _owner) public view returns (uint256) { 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.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 1056, 1168 ] }
3,428
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
StandardToken
contract StandardToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
/** * @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(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; }
/** * @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.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 1532, 2082 ] }
3,429
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
StandardToken
contract StandardToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
/** * @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; emit 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 * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 2718, 2929 ] }
3,430
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
StandardToken
contract StandardToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
/** * @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.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 3260, 3456 ] }
3,431
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
StandardToken
contract StandardToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
/** * @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, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit 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 _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 3926, 4274 ] }
3,432
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
StandardToken
contract StandardToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
/** * @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, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
/** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 4749, 5259 ] }
3,433
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
BurnableToken
contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } }
/** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */
NatSpecMultiLine
burn
function burn(uint256 _value) public { _burn(msg.sender, _value); }
/** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 222, 308 ] }
3,434
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
MintableToken
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) hasMintPermission canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } }
/** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */
NatSpecMultiLine
mint
function mint( address _to, uint256 _amount ) hasMintPermission canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit 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.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 604, 985 ] }
3,435
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
MintableToken
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) hasMintPermission canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } }
/** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * 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; emit MintFinished(); return true; }
/** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 1107, 1270 ] }
3,436
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
Controlled
contract Controlled is Ownable{ constructor() public { setExclude(msg.sender); } // Flag that determines if the token is transferable or not. bool public transferEnabled = false; // flag that makes locked address effect bool public plockFlag=true; mapping(address => bool) locked; mapping(address => bool) exclude; // 控制全局全局锁 function enableTransfer(bool _enable) public onlyOwner{ transferEnabled = _enable; } // 控制个人锁功能 function enableLockFlag(bool _enable) public onlyOwner returns (bool success){ plockFlag = _enable; return true; } function addLock(address _addr) public onlyOwner returns (bool success){ require(_addr!=msg.sender); locked[_addr] = true; return true; } function setExclude(address _addr) public onlyOwner returns (bool success){ exclude[_addr] = true; return true; } function removeLock(address _addr) public onlyOwner returns (bool success){ locked[_addr] = false; return true; } modifier transferAllowed(address _addr) { if (!exclude[_addr]) { // flase抛异常,并扣除gas消耗 assert(transferEnabled); if(plockFlag){ assert(!locked[_addr]); } } _; } }
enableTransfer
function enableTransfer(bool _enable) public onlyOwner{ transferEnabled = _enable; }
// 控制全局全局锁
LineComment
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 389, 492 ] }
3,437
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
Controlled
contract Controlled is Ownable{ constructor() public { setExclude(msg.sender); } // Flag that determines if the token is transferable or not. bool public transferEnabled = false; // flag that makes locked address effect bool public plockFlag=true; mapping(address => bool) locked; mapping(address => bool) exclude; // 控制全局全局锁 function enableTransfer(bool _enable) public onlyOwner{ transferEnabled = _enable; } // 控制个人锁功能 function enableLockFlag(bool _enable) public onlyOwner returns (bool success){ plockFlag = _enable; return true; } function addLock(address _addr) public onlyOwner returns (bool success){ require(_addr!=msg.sender); locked[_addr] = true; return true; } function setExclude(address _addr) public onlyOwner returns (bool success){ exclude[_addr] = true; return true; } function removeLock(address _addr) public onlyOwner returns (bool success){ locked[_addr] = false; return true; } modifier transferAllowed(address _addr) { if (!exclude[_addr]) { // flase抛异常,并扣除gas消耗 assert(transferEnabled); if(plockFlag){ assert(!locked[_addr]); } } _; } }
enableLockFlag
function enableLockFlag(bool _enable) public onlyOwner returns (bool success){ plockFlag = _enable; return true; }
// 控制个人锁功能
LineComment
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 511, 653 ] }
3,438
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
Fitcoin
contract Fitcoin is BurnableToken, MintableToken, PausableToken { // Public variables of the token string public name; string public symbol; // decimals is the strongly suggested default, avoid changing it uint8 public decimals; constructor() public { name = "Fitcoin"; symbol = "FIT"; decimals = 18; totalSupply_ = 10000000000 * 10 ** uint256(decimals); // Allocate initial balance to the owner balances[msg.sender] = totalSupply_; } // transfer balance to owner function withdrawEther() onlyOwner public { address addr = this; owner.transfer(addr.balance); } // can accept ether function() payable public { } // Allocate tokens to the users // @param _owners The owners list of the token // @param _values The value list of the token function allocateTokens(address[] _owners, uint256[] _values) public onlyOwner { require(_owners.length == _values.length, "data length mismatch"); address from = msg.sender; for(uint256 i = 0; i < _owners.length ; i++){ address to = _owners[i]; uint256 value = _values[i]; require(value <= balances[from]); balances[to] = balances[to].add(value); balances[from] = balances[from].sub(value); emit Transfer(from, to, value); } } }
/* * @title Fitcoin */
Comment
withdrawEther
function withdrawEther() onlyOwner public { address addr = this; owner.transfer(addr.balance); }
// transfer balance to owner
LineComment
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 565, 689 ] }
3,439
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
Fitcoin
contract Fitcoin is BurnableToken, MintableToken, PausableToken { // Public variables of the token string public name; string public symbol; // decimals is the strongly suggested default, avoid changing it uint8 public decimals; constructor() public { name = "Fitcoin"; symbol = "FIT"; decimals = 18; totalSupply_ = 10000000000 * 10 ** uint256(decimals); // Allocate initial balance to the owner balances[msg.sender] = totalSupply_; } // transfer balance to owner function withdrawEther() onlyOwner public { address addr = this; owner.transfer(addr.balance); } // can accept ether function() payable public { } // Allocate tokens to the users // @param _owners The owners list of the token // @param _values The value list of the token function allocateTokens(address[] _owners, uint256[] _values) public onlyOwner { require(_owners.length == _values.length, "data length mismatch"); address from = msg.sender; for(uint256 i = 0; i < _owners.length ; i++){ address to = _owners[i]; uint256 value = _values[i]; require(value <= balances[from]); balances[to] = balances[to].add(value); balances[from] = balances[from].sub(value); emit Transfer(from, to, value); } } }
/* * @title Fitcoin */
Comment
function() payable public { }
// can accept ether
LineComment
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 717, 751 ] }
3,440
Fitcoin
Fitcoin.sol
0x32739415398b642c8c0e0b76c509a10e065ead81
Solidity
Fitcoin
contract Fitcoin is BurnableToken, MintableToken, PausableToken { // Public variables of the token string public name; string public symbol; // decimals is the strongly suggested default, avoid changing it uint8 public decimals; constructor() public { name = "Fitcoin"; symbol = "FIT"; decimals = 18; totalSupply_ = 10000000000 * 10 ** uint256(decimals); // Allocate initial balance to the owner balances[msg.sender] = totalSupply_; } // transfer balance to owner function withdrawEther() onlyOwner public { address addr = this; owner.transfer(addr.balance); } // can accept ether function() payable public { } // Allocate tokens to the users // @param _owners The owners list of the token // @param _values The value list of the token function allocateTokens(address[] _owners, uint256[] _values) public onlyOwner { require(_owners.length == _values.length, "data length mismatch"); address from = msg.sender; for(uint256 i = 0; i < _owners.length ; i++){ address to = _owners[i]; uint256 value = _values[i]; require(value <= balances[from]); balances[to] = balances[to].add(value); balances[from] = balances[from].sub(value); emit Transfer(from, to, value); } } }
/* * @title Fitcoin */
Comment
allocateTokens
function allocateTokens(address[] _owners, uint256[] _values) public onlyOwner { require(_owners.length == _values.length, "data length mismatch"); address from = msg.sender; for(uint256 i = 0; i < _owners.length ; i++){ address to = _owners[i]; uint256 value = _values[i]; require(value <= balances[from]); balances[to] = balances[to].add(value); balances[from] = balances[from].sub(value); emit Transfer(from, to, value); } }
// Allocate tokens to the users // @param _owners The owners list of the token // @param _values The value list of the token
LineComment
v0.4.24+commit.e67f0147
bzzr://6cc1a2b0ccde428396cd672dc08baecce6020acffa038460ba83ec5061648743
{ "func_code_index": [ 894, 1451 ] }
3,441
Token
contracts/interfaces/IToken.sol
0x8ebfe1e17ea41f8b737e4f7670885b2278b1cc32
Solidity
IToken
interface IToken is IERC20 { struct Distribution { address recipient; uint256 amount; } error NonZeroTotalSupply(uint256 totalSupply); /** * @notice Mints tokens according to `distributions` array, only one distribution is possible * * @param distributions Array of the Distribution structs, * which describe recipients and the corresponding amounts * * Requirements: * * - `_msgSender()` should be an owner * - `totalSupply()` should be equal to zero */ function distribute(Distribution[] calldata distributions) external; }
distribute
function distribute(Distribution[] calldata distributions) external;
/** * @notice Mints tokens according to `distributions` array, only one distribution is possible * * @param distributions Array of the Distribution structs, * which describe recipients and the corresponding amounts * * Requirements: * * - `_msgSender()` should be an owner * - `totalSupply()` should be equal to zero */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 539, 611 ] }
3,442
Token
contracts/Token.sol
0x8ebfe1e17ea41f8b737e4f7670885b2278b1cc32
Solidity
Token
contract Token is Ownable, ERC20VotesComp, IToken { // Token name string internal constant NAME = "Chadverse Token"; // Token symbol string internal constant SYMBOL = "ROIDZ"; /// @notice Token initialization constructor() ERC20(NAME, SYMBOL) ERC20Permit(NAME) { //solhint-disable-previous-line no-empty-blocks } /// @inheritdoc IToken function distribute(Distribution[] calldata distributions) external override onlyOwner { if (totalSupply() != uint256(0)) revert NonZeroTotalSupply(totalSupply()); for (uint256 i = 0; i < distributions.length; i++) { _mint(distributions[i].recipient, distributions[i].amount); } } }
distribute
function distribute(Distribution[] calldata distributions) external override onlyOwner { if (totalSupply() != uint256(0)) revert NonZeroTotalSupply(totalSupply()); for (uint256 i = 0; i < distributions.length; i++) { _mint(distributions[i].recipient, distributions[i].amount); } }
/// @inheritdoc IToken
NatSpecSingleLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 379, 704 ] }
3,443
AdminUpgradeabilityProxy
Ownable.sol
0xa89412ce8706735bb694f4a6de714a0a42e8a1e2
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */
NatSpecMultiLine
owner
function owner() public view virtual returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
ipfs://46d2e76e4f2da32f9295a400f439f9ec11acaee0cbc86f5feac4d8a16ca55dd3
{ "func_code_index": [ 510, 599 ] }
3,444
AdminUpgradeabilityProxy
Ownable.sol
0xa89412ce8706735bb694f4a6de714a0a42e8a1e2
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */
NatSpecMultiLine
renounceOwnership
function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); }
/** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
ipfs://46d2e76e4f2da32f9295a400f439f9ec11acaee0cbc86f5feac4d8a16ca55dd3
{ "func_code_index": [ 1142, 1291 ] }
3,445
AdminUpgradeabilityProxy
Ownable.sol
0xa89412ce8706735bb694f4a6de714a0a42e8a1e2
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
/** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
ipfs://46d2e76e4f2da32f9295a400f439f9ec11acaee0cbc86f5feac4d8a16ca55dd3
{ "func_code_index": [ 1436, 1714 ] }
3,446
Token
@openzeppelin/contracts/utils/math/Math.sol
0x8ebfe1e17ea41f8b737e4f7670885b2278b1cc32
Solidity
Math
library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
/** * @dev Standard math utilities missing in the Solidity language. */
NatSpecMultiLine
max
function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; }
/** * @dev Returns the largest of two numbers. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 79, 188 ] }
3,447
Token
@openzeppelin/contracts/utils/math/Math.sol
0x8ebfe1e17ea41f8b737e4f7670885b2278b1cc32
Solidity
Math
library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
/** * @dev Standard math utilities missing in the Solidity language. */
NatSpecMultiLine
min
function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; }
/** * @dev Returns the smallest of two numbers. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 255, 363 ] }
3,448
Token
@openzeppelin/contracts/utils/math/Math.sol
0x8ebfe1e17ea41f8b737e4f7670885b2278b1cc32
Solidity
Math
library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
/** * @dev Standard math utilities missing in the Solidity language. */
NatSpecMultiLine
average
function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; }
/** * @dev Returns the average of two numbers. The result is rounded towards * zero. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 472, 629 ] }
3,449
Token
@openzeppelin/contracts/utils/math/Math.sol
0x8ebfe1e17ea41f8b737e4f7670885b2278b1cc32
Solidity
Math
library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
/** * @dev Standard math utilities missing in the Solidity language. */
NatSpecMultiLine
ceilDiv
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); }
/** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 824, 1022 ] }
3,450
NFTCheese
contracts/NFTCheese.sol
0x1b603c18bc6766c0e6abcae9d83e8662d75b1b96
Solidity
NFTCheese
contract NFTCheese is AbstractERC1155Factory { uint256 public constant ARTWORK = 0; uint256 public _maxSupply = 333; uint256 public _reserved = 33; uint8 maxPerTx = 2; uint256 public whitelistWindowOpens = 1644523200; uint256 public publicWindowOpens = 1644609600; uint256 public priceInc = 100000000000000000; uint256 public incrementNumber= 50; uint256 public startingPrice = 50000000000000000; mapping(address => bool) private whiteList; mapping(address => uint256) public purchaseTxs; constructor( address[] memory _payees, uint256[] memory _shares, string memory _name, string memory _symbol, string memory _uri ) ERC1155(_uri) PaymentSplitter(_payees, _shares) { name_ = _name; symbol_ = _symbol; _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(DEFAULT_ADMIN_ROLE, 0x5DeD00BE946085E7a523803596706593DbF9959b); _mint(0x5DeD00BE946085E7a523803596706593DbF9959b, ARTWORK, 33, ""); } /** * @notice retrieve price for multiple NFTs * * @param amount the amount of NFTs to get price for */ function getPrice(uint256 amount) public view returns (uint256){ uint256 supply = totalSupply(ARTWORK) - _reserved; uint totalCost = 0; for (uint i = 0; i < amount; i++) { totalCost += getCurrentPriceAtPosition(supply + i); } return totalCost; } /** * @notice get price at position of the NFT token by ID * * @param position positiong to check the price at */ function getCurrentPriceAtPosition(uint256 position) public view returns (uint256){ uint256 multiplier = position/incrementNumber; uint256 priceIncrease = multiplier * priceInc; return priceIncrease + startingPrice; } /** * @notice purchase NFTs during whitelist mint * * @param amount the amount of cards to purchase */ function whitelistMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= whitelistWindowOpens, "Early access: window closed"); require(whiteList[msg.sender], "Sender not on the whitelist"); require(purchaseTxs[msg.sender] + amount <= maxPerTx, "Wallet mint limit"); mint(amount); } /** * @notice mint NFTs during public mint * * @param amount the amount of tokens to mint */ function publicMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= publicWindowOpens, "Purchase: window closed"); mint(amount); } /** * @notice global mint function used in early access and public sale * * @param amount the amount of tokens to mint */ function mint(uint256 amount) private { require(amount > 0, "Need to request at least 1 NFT"); require(totalSupply(ARTWORK) + amount <= _maxSupply, "Exceeds maximum supply"); require(msg.value >= getPrice(amount), "Not enough ETH sent, check price"); purchaseTxs[msg.sender] += amount; _mint(msg.sender, ARTWORK, amount, ""); } /** * @notice edit windows * * @param _publicWindowOpens UNIX timestamp for purchasing public window time * @param _whitelistWindowOpens UNIX timestamp for purchasing whitelist window time */ function editWindows( uint256 _publicWindowOpens, uint256 _whitelistWindowOpens ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _publicWindowOpens > _whitelistWindowOpens, "window combination not allowed" ); publicWindowOpens = _publicWindowOpens; whitelistWindowOpens = _whitelistWindowOpens; } /** * @notice edit mint settings * * @param _priceInc how much the price increments * @param _incrementNumber per how many tokens to increase price * @param _startingPrice starting price of the token */ function editMintSettings( uint256 _priceInc, uint256 _incrementNumber, uint256 _startingPrice ) external onlyRole(DEFAULT_ADMIN_ROLE) { priceInc = _priceInc; incrementNumber = _incrementNumber; startingPrice = _startingPrice; } /** * @notice adds addresses into a whitelist * * @param addresses an array of addresses to add to whitelist */ function setWhiteList(address[] calldata addresses ) external onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i = 0; i < addresses.length; i++) { whiteList[addresses[i]] = true; } } /** * @notice returns true or false depending on */ function isWhitelisted() external view returns (bool) { return whiteList[msg.sender]; } /** * @notice returns the metadata uri for a given id * * @param _id the NFT id to return metadata for */ function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), "URI: nonexistent token"); return string(abi.encodePacked(super.uri(_id), Strings.toString(_id), ".json")); } }
/* * @title ERC1155 token for NFT Cheese * @author Nazariy Dumanskyy, Lem Canady */
Comment
getPrice
function getPrice(uint256 amount) public view returns (uint256){ uint256 supply = totalSupply(ARTWORK) - _reserved; uint totalCost = 0; for (uint i = 0; i < amount; i++) { totalCost += getCurrentPriceAtPosition(supply + i); } return totalCost; }
/** * @notice retrieve price for multiple NFTs * * @param amount the amount of NFTs to get price for */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://322cf1e12fc4613d5b6be99d2da7163e6d3d01e08e1af01097d9a4bbfc44238d
{ "func_code_index": [ 1205, 1519 ] }
3,451
NFTCheese
contracts/NFTCheese.sol
0x1b603c18bc6766c0e6abcae9d83e8662d75b1b96
Solidity
NFTCheese
contract NFTCheese is AbstractERC1155Factory { uint256 public constant ARTWORK = 0; uint256 public _maxSupply = 333; uint256 public _reserved = 33; uint8 maxPerTx = 2; uint256 public whitelistWindowOpens = 1644523200; uint256 public publicWindowOpens = 1644609600; uint256 public priceInc = 100000000000000000; uint256 public incrementNumber= 50; uint256 public startingPrice = 50000000000000000; mapping(address => bool) private whiteList; mapping(address => uint256) public purchaseTxs; constructor( address[] memory _payees, uint256[] memory _shares, string memory _name, string memory _symbol, string memory _uri ) ERC1155(_uri) PaymentSplitter(_payees, _shares) { name_ = _name; symbol_ = _symbol; _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(DEFAULT_ADMIN_ROLE, 0x5DeD00BE946085E7a523803596706593DbF9959b); _mint(0x5DeD00BE946085E7a523803596706593DbF9959b, ARTWORK, 33, ""); } /** * @notice retrieve price for multiple NFTs * * @param amount the amount of NFTs to get price for */ function getPrice(uint256 amount) public view returns (uint256){ uint256 supply = totalSupply(ARTWORK) - _reserved; uint totalCost = 0; for (uint i = 0; i < amount; i++) { totalCost += getCurrentPriceAtPosition(supply + i); } return totalCost; } /** * @notice get price at position of the NFT token by ID * * @param position positiong to check the price at */ function getCurrentPriceAtPosition(uint256 position) public view returns (uint256){ uint256 multiplier = position/incrementNumber; uint256 priceIncrease = multiplier * priceInc; return priceIncrease + startingPrice; } /** * @notice purchase NFTs during whitelist mint * * @param amount the amount of cards to purchase */ function whitelistMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= whitelistWindowOpens, "Early access: window closed"); require(whiteList[msg.sender], "Sender not on the whitelist"); require(purchaseTxs[msg.sender] + amount <= maxPerTx, "Wallet mint limit"); mint(amount); } /** * @notice mint NFTs during public mint * * @param amount the amount of tokens to mint */ function publicMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= publicWindowOpens, "Purchase: window closed"); mint(amount); } /** * @notice global mint function used in early access and public sale * * @param amount the amount of tokens to mint */ function mint(uint256 amount) private { require(amount > 0, "Need to request at least 1 NFT"); require(totalSupply(ARTWORK) + amount <= _maxSupply, "Exceeds maximum supply"); require(msg.value >= getPrice(amount), "Not enough ETH sent, check price"); purchaseTxs[msg.sender] += amount; _mint(msg.sender, ARTWORK, amount, ""); } /** * @notice edit windows * * @param _publicWindowOpens UNIX timestamp for purchasing public window time * @param _whitelistWindowOpens UNIX timestamp for purchasing whitelist window time */ function editWindows( uint256 _publicWindowOpens, uint256 _whitelistWindowOpens ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _publicWindowOpens > _whitelistWindowOpens, "window combination not allowed" ); publicWindowOpens = _publicWindowOpens; whitelistWindowOpens = _whitelistWindowOpens; } /** * @notice edit mint settings * * @param _priceInc how much the price increments * @param _incrementNumber per how many tokens to increase price * @param _startingPrice starting price of the token */ function editMintSettings( uint256 _priceInc, uint256 _incrementNumber, uint256 _startingPrice ) external onlyRole(DEFAULT_ADMIN_ROLE) { priceInc = _priceInc; incrementNumber = _incrementNumber; startingPrice = _startingPrice; } /** * @notice adds addresses into a whitelist * * @param addresses an array of addresses to add to whitelist */ function setWhiteList(address[] calldata addresses ) external onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i = 0; i < addresses.length; i++) { whiteList[addresses[i]] = true; } } /** * @notice returns true or false depending on */ function isWhitelisted() external view returns (bool) { return whiteList[msg.sender]; } /** * @notice returns the metadata uri for a given id * * @param _id the NFT id to return metadata for */ function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), "URI: nonexistent token"); return string(abi.encodePacked(super.uri(_id), Strings.toString(_id), ".json")); } }
/* * @title ERC1155 token for NFT Cheese * @author Nazariy Dumanskyy, Lem Canady */
Comment
getCurrentPriceAtPosition
function getCurrentPriceAtPosition(uint256 position) public view returns (uint256){ uint256 multiplier = position/incrementNumber; uint256 priceIncrease = multiplier * priceInc; return priceIncrease + startingPrice; }
/** * @notice get price at position of the NFT token by ID * * @param position positiong to check the price at */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://322cf1e12fc4613d5b6be99d2da7163e6d3d01e08e1af01097d9a4bbfc44238d
{ "func_code_index": [ 1661, 1917 ] }
3,452
NFTCheese
contracts/NFTCheese.sol
0x1b603c18bc6766c0e6abcae9d83e8662d75b1b96
Solidity
NFTCheese
contract NFTCheese is AbstractERC1155Factory { uint256 public constant ARTWORK = 0; uint256 public _maxSupply = 333; uint256 public _reserved = 33; uint8 maxPerTx = 2; uint256 public whitelistWindowOpens = 1644523200; uint256 public publicWindowOpens = 1644609600; uint256 public priceInc = 100000000000000000; uint256 public incrementNumber= 50; uint256 public startingPrice = 50000000000000000; mapping(address => bool) private whiteList; mapping(address => uint256) public purchaseTxs; constructor( address[] memory _payees, uint256[] memory _shares, string memory _name, string memory _symbol, string memory _uri ) ERC1155(_uri) PaymentSplitter(_payees, _shares) { name_ = _name; symbol_ = _symbol; _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(DEFAULT_ADMIN_ROLE, 0x5DeD00BE946085E7a523803596706593DbF9959b); _mint(0x5DeD00BE946085E7a523803596706593DbF9959b, ARTWORK, 33, ""); } /** * @notice retrieve price for multiple NFTs * * @param amount the amount of NFTs to get price for */ function getPrice(uint256 amount) public view returns (uint256){ uint256 supply = totalSupply(ARTWORK) - _reserved; uint totalCost = 0; for (uint i = 0; i < amount; i++) { totalCost += getCurrentPriceAtPosition(supply + i); } return totalCost; } /** * @notice get price at position of the NFT token by ID * * @param position positiong to check the price at */ function getCurrentPriceAtPosition(uint256 position) public view returns (uint256){ uint256 multiplier = position/incrementNumber; uint256 priceIncrease = multiplier * priceInc; return priceIncrease + startingPrice; } /** * @notice purchase NFTs during whitelist mint * * @param amount the amount of cards to purchase */ function whitelistMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= whitelistWindowOpens, "Early access: window closed"); require(whiteList[msg.sender], "Sender not on the whitelist"); require(purchaseTxs[msg.sender] + amount <= maxPerTx, "Wallet mint limit"); mint(amount); } /** * @notice mint NFTs during public mint * * @param amount the amount of tokens to mint */ function publicMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= publicWindowOpens, "Purchase: window closed"); mint(amount); } /** * @notice global mint function used in early access and public sale * * @param amount the amount of tokens to mint */ function mint(uint256 amount) private { require(amount > 0, "Need to request at least 1 NFT"); require(totalSupply(ARTWORK) + amount <= _maxSupply, "Exceeds maximum supply"); require(msg.value >= getPrice(amount), "Not enough ETH sent, check price"); purchaseTxs[msg.sender] += amount; _mint(msg.sender, ARTWORK, amount, ""); } /** * @notice edit windows * * @param _publicWindowOpens UNIX timestamp for purchasing public window time * @param _whitelistWindowOpens UNIX timestamp for purchasing whitelist window time */ function editWindows( uint256 _publicWindowOpens, uint256 _whitelistWindowOpens ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _publicWindowOpens > _whitelistWindowOpens, "window combination not allowed" ); publicWindowOpens = _publicWindowOpens; whitelistWindowOpens = _whitelistWindowOpens; } /** * @notice edit mint settings * * @param _priceInc how much the price increments * @param _incrementNumber per how many tokens to increase price * @param _startingPrice starting price of the token */ function editMintSettings( uint256 _priceInc, uint256 _incrementNumber, uint256 _startingPrice ) external onlyRole(DEFAULT_ADMIN_ROLE) { priceInc = _priceInc; incrementNumber = _incrementNumber; startingPrice = _startingPrice; } /** * @notice adds addresses into a whitelist * * @param addresses an array of addresses to add to whitelist */ function setWhiteList(address[] calldata addresses ) external onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i = 0; i < addresses.length; i++) { whiteList[addresses[i]] = true; } } /** * @notice returns true or false depending on */ function isWhitelisted() external view returns (bool) { return whiteList[msg.sender]; } /** * @notice returns the metadata uri for a given id * * @param _id the NFT id to return metadata for */ function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), "URI: nonexistent token"); return string(abi.encodePacked(super.uri(_id), Strings.toString(_id), ".json")); } }
/* * @title ERC1155 token for NFT Cheese * @author Nazariy Dumanskyy, Lem Canady */
Comment
whitelistMint
function whitelistMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= whitelistWindowOpens, "Early access: window closed"); require(whiteList[msg.sender], "Sender not on the whitelist"); require(purchaseTxs[msg.sender] + amount <= maxPerTx, "Wallet mint limit"); mint(amount); }
/** * @notice purchase NFTs during whitelist mint * * @param amount the amount of cards to purchase */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://322cf1e12fc4613d5b6be99d2da7163e6d3d01e08e1af01097d9a4bbfc44238d
{ "func_code_index": [ 2048, 2403 ] }
3,453
NFTCheese
contracts/NFTCheese.sol
0x1b603c18bc6766c0e6abcae9d83e8662d75b1b96
Solidity
NFTCheese
contract NFTCheese is AbstractERC1155Factory { uint256 public constant ARTWORK = 0; uint256 public _maxSupply = 333; uint256 public _reserved = 33; uint8 maxPerTx = 2; uint256 public whitelistWindowOpens = 1644523200; uint256 public publicWindowOpens = 1644609600; uint256 public priceInc = 100000000000000000; uint256 public incrementNumber= 50; uint256 public startingPrice = 50000000000000000; mapping(address => bool) private whiteList; mapping(address => uint256) public purchaseTxs; constructor( address[] memory _payees, uint256[] memory _shares, string memory _name, string memory _symbol, string memory _uri ) ERC1155(_uri) PaymentSplitter(_payees, _shares) { name_ = _name; symbol_ = _symbol; _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(DEFAULT_ADMIN_ROLE, 0x5DeD00BE946085E7a523803596706593DbF9959b); _mint(0x5DeD00BE946085E7a523803596706593DbF9959b, ARTWORK, 33, ""); } /** * @notice retrieve price for multiple NFTs * * @param amount the amount of NFTs to get price for */ function getPrice(uint256 amount) public view returns (uint256){ uint256 supply = totalSupply(ARTWORK) - _reserved; uint totalCost = 0; for (uint i = 0; i < amount; i++) { totalCost += getCurrentPriceAtPosition(supply + i); } return totalCost; } /** * @notice get price at position of the NFT token by ID * * @param position positiong to check the price at */ function getCurrentPriceAtPosition(uint256 position) public view returns (uint256){ uint256 multiplier = position/incrementNumber; uint256 priceIncrease = multiplier * priceInc; return priceIncrease + startingPrice; } /** * @notice purchase NFTs during whitelist mint * * @param amount the amount of cards to purchase */ function whitelistMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= whitelistWindowOpens, "Early access: window closed"); require(whiteList[msg.sender], "Sender not on the whitelist"); require(purchaseTxs[msg.sender] + amount <= maxPerTx, "Wallet mint limit"); mint(amount); } /** * @notice mint NFTs during public mint * * @param amount the amount of tokens to mint */ function publicMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= publicWindowOpens, "Purchase: window closed"); mint(amount); } /** * @notice global mint function used in early access and public sale * * @param amount the amount of tokens to mint */ function mint(uint256 amount) private { require(amount > 0, "Need to request at least 1 NFT"); require(totalSupply(ARTWORK) + amount <= _maxSupply, "Exceeds maximum supply"); require(msg.value >= getPrice(amount), "Not enough ETH sent, check price"); purchaseTxs[msg.sender] += amount; _mint(msg.sender, ARTWORK, amount, ""); } /** * @notice edit windows * * @param _publicWindowOpens UNIX timestamp for purchasing public window time * @param _whitelistWindowOpens UNIX timestamp for purchasing whitelist window time */ function editWindows( uint256 _publicWindowOpens, uint256 _whitelistWindowOpens ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _publicWindowOpens > _whitelistWindowOpens, "window combination not allowed" ); publicWindowOpens = _publicWindowOpens; whitelistWindowOpens = _whitelistWindowOpens; } /** * @notice edit mint settings * * @param _priceInc how much the price increments * @param _incrementNumber per how many tokens to increase price * @param _startingPrice starting price of the token */ function editMintSettings( uint256 _priceInc, uint256 _incrementNumber, uint256 _startingPrice ) external onlyRole(DEFAULT_ADMIN_ROLE) { priceInc = _priceInc; incrementNumber = _incrementNumber; startingPrice = _startingPrice; } /** * @notice adds addresses into a whitelist * * @param addresses an array of addresses to add to whitelist */ function setWhiteList(address[] calldata addresses ) external onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i = 0; i < addresses.length; i++) { whiteList[addresses[i]] = true; } } /** * @notice returns true or false depending on */ function isWhitelisted() external view returns (bool) { return whiteList[msg.sender]; } /** * @notice returns the metadata uri for a given id * * @param _id the NFT id to return metadata for */ function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), "URI: nonexistent token"); return string(abi.encodePacked(super.uri(_id), Strings.toString(_id), ".json")); } }
/* * @title ERC1155 token for NFT Cheese * @author Nazariy Dumanskyy, Lem Canady */
Comment
publicMint
function publicMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= publicWindowOpens, "Purchase: window closed"); mint(amount); }
/** * @notice mint NFTs during public mint * * @param amount the amount of tokens to mint */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://322cf1e12fc4613d5b6be99d2da7163e6d3d01e08e1af01097d9a4bbfc44238d
{ "func_code_index": [ 2524, 2712 ] }
3,454
NFTCheese
contracts/NFTCheese.sol
0x1b603c18bc6766c0e6abcae9d83e8662d75b1b96
Solidity
NFTCheese
contract NFTCheese is AbstractERC1155Factory { uint256 public constant ARTWORK = 0; uint256 public _maxSupply = 333; uint256 public _reserved = 33; uint8 maxPerTx = 2; uint256 public whitelistWindowOpens = 1644523200; uint256 public publicWindowOpens = 1644609600; uint256 public priceInc = 100000000000000000; uint256 public incrementNumber= 50; uint256 public startingPrice = 50000000000000000; mapping(address => bool) private whiteList; mapping(address => uint256) public purchaseTxs; constructor( address[] memory _payees, uint256[] memory _shares, string memory _name, string memory _symbol, string memory _uri ) ERC1155(_uri) PaymentSplitter(_payees, _shares) { name_ = _name; symbol_ = _symbol; _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(DEFAULT_ADMIN_ROLE, 0x5DeD00BE946085E7a523803596706593DbF9959b); _mint(0x5DeD00BE946085E7a523803596706593DbF9959b, ARTWORK, 33, ""); } /** * @notice retrieve price for multiple NFTs * * @param amount the amount of NFTs to get price for */ function getPrice(uint256 amount) public view returns (uint256){ uint256 supply = totalSupply(ARTWORK) - _reserved; uint totalCost = 0; for (uint i = 0; i < amount; i++) { totalCost += getCurrentPriceAtPosition(supply + i); } return totalCost; } /** * @notice get price at position of the NFT token by ID * * @param position positiong to check the price at */ function getCurrentPriceAtPosition(uint256 position) public view returns (uint256){ uint256 multiplier = position/incrementNumber; uint256 priceIncrease = multiplier * priceInc; return priceIncrease + startingPrice; } /** * @notice purchase NFTs during whitelist mint * * @param amount the amount of cards to purchase */ function whitelistMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= whitelistWindowOpens, "Early access: window closed"); require(whiteList[msg.sender], "Sender not on the whitelist"); require(purchaseTxs[msg.sender] + amount <= maxPerTx, "Wallet mint limit"); mint(amount); } /** * @notice mint NFTs during public mint * * @param amount the amount of tokens to mint */ function publicMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= publicWindowOpens, "Purchase: window closed"); mint(amount); } /** * @notice global mint function used in early access and public sale * * @param amount the amount of tokens to mint */ function mint(uint256 amount) private { require(amount > 0, "Need to request at least 1 NFT"); require(totalSupply(ARTWORK) + amount <= _maxSupply, "Exceeds maximum supply"); require(msg.value >= getPrice(amount), "Not enough ETH sent, check price"); purchaseTxs[msg.sender] += amount; _mint(msg.sender, ARTWORK, amount, ""); } /** * @notice edit windows * * @param _publicWindowOpens UNIX timestamp for purchasing public window time * @param _whitelistWindowOpens UNIX timestamp for purchasing whitelist window time */ function editWindows( uint256 _publicWindowOpens, uint256 _whitelistWindowOpens ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _publicWindowOpens > _whitelistWindowOpens, "window combination not allowed" ); publicWindowOpens = _publicWindowOpens; whitelistWindowOpens = _whitelistWindowOpens; } /** * @notice edit mint settings * * @param _priceInc how much the price increments * @param _incrementNumber per how many tokens to increase price * @param _startingPrice starting price of the token */ function editMintSettings( uint256 _priceInc, uint256 _incrementNumber, uint256 _startingPrice ) external onlyRole(DEFAULT_ADMIN_ROLE) { priceInc = _priceInc; incrementNumber = _incrementNumber; startingPrice = _startingPrice; } /** * @notice adds addresses into a whitelist * * @param addresses an array of addresses to add to whitelist */ function setWhiteList(address[] calldata addresses ) external onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i = 0; i < addresses.length; i++) { whiteList[addresses[i]] = true; } } /** * @notice returns true or false depending on */ function isWhitelisted() external view returns (bool) { return whiteList[msg.sender]; } /** * @notice returns the metadata uri for a given id * * @param _id the NFT id to return metadata for */ function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), "URI: nonexistent token"); return string(abi.encodePacked(super.uri(_id), Strings.toString(_id), ".json")); } }
/* * @title ERC1155 token for NFT Cheese * @author Nazariy Dumanskyy, Lem Canady */
Comment
mint
function mint(uint256 amount) private { require(amount > 0, "Need to request at least 1 NFT"); require(totalSupply(ARTWORK) + amount <= _maxSupply, "Exceeds maximum supply"); require(msg.value >= getPrice(amount), "Not enough ETH sent, check price"); purchaseTxs[msg.sender] += amount; _mint(msg.sender, ARTWORK, amount, ""); }
/** * @notice global mint function used in early access and public sale * * @param amount the amount of tokens to mint */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://322cf1e12fc4613d5b6be99d2da7163e6d3d01e08e1af01097d9a4bbfc44238d
{ "func_code_index": [ 2862, 3246 ] }
3,455
NFTCheese
contracts/NFTCheese.sol
0x1b603c18bc6766c0e6abcae9d83e8662d75b1b96
Solidity
NFTCheese
contract NFTCheese is AbstractERC1155Factory { uint256 public constant ARTWORK = 0; uint256 public _maxSupply = 333; uint256 public _reserved = 33; uint8 maxPerTx = 2; uint256 public whitelistWindowOpens = 1644523200; uint256 public publicWindowOpens = 1644609600; uint256 public priceInc = 100000000000000000; uint256 public incrementNumber= 50; uint256 public startingPrice = 50000000000000000; mapping(address => bool) private whiteList; mapping(address => uint256) public purchaseTxs; constructor( address[] memory _payees, uint256[] memory _shares, string memory _name, string memory _symbol, string memory _uri ) ERC1155(_uri) PaymentSplitter(_payees, _shares) { name_ = _name; symbol_ = _symbol; _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(DEFAULT_ADMIN_ROLE, 0x5DeD00BE946085E7a523803596706593DbF9959b); _mint(0x5DeD00BE946085E7a523803596706593DbF9959b, ARTWORK, 33, ""); } /** * @notice retrieve price for multiple NFTs * * @param amount the amount of NFTs to get price for */ function getPrice(uint256 amount) public view returns (uint256){ uint256 supply = totalSupply(ARTWORK) - _reserved; uint totalCost = 0; for (uint i = 0; i < amount; i++) { totalCost += getCurrentPriceAtPosition(supply + i); } return totalCost; } /** * @notice get price at position of the NFT token by ID * * @param position positiong to check the price at */ function getCurrentPriceAtPosition(uint256 position) public view returns (uint256){ uint256 multiplier = position/incrementNumber; uint256 priceIncrease = multiplier * priceInc; return priceIncrease + startingPrice; } /** * @notice purchase NFTs during whitelist mint * * @param amount the amount of cards to purchase */ function whitelistMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= whitelistWindowOpens, "Early access: window closed"); require(whiteList[msg.sender], "Sender not on the whitelist"); require(purchaseTxs[msg.sender] + amount <= maxPerTx, "Wallet mint limit"); mint(amount); } /** * @notice mint NFTs during public mint * * @param amount the amount of tokens to mint */ function publicMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= publicWindowOpens, "Purchase: window closed"); mint(amount); } /** * @notice global mint function used in early access and public sale * * @param amount the amount of tokens to mint */ function mint(uint256 amount) private { require(amount > 0, "Need to request at least 1 NFT"); require(totalSupply(ARTWORK) + amount <= _maxSupply, "Exceeds maximum supply"); require(msg.value >= getPrice(amount), "Not enough ETH sent, check price"); purchaseTxs[msg.sender] += amount; _mint(msg.sender, ARTWORK, amount, ""); } /** * @notice edit windows * * @param _publicWindowOpens UNIX timestamp for purchasing public window time * @param _whitelistWindowOpens UNIX timestamp for purchasing whitelist window time */ function editWindows( uint256 _publicWindowOpens, uint256 _whitelistWindowOpens ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _publicWindowOpens > _whitelistWindowOpens, "window combination not allowed" ); publicWindowOpens = _publicWindowOpens; whitelistWindowOpens = _whitelistWindowOpens; } /** * @notice edit mint settings * * @param _priceInc how much the price increments * @param _incrementNumber per how many tokens to increase price * @param _startingPrice starting price of the token */ function editMintSettings( uint256 _priceInc, uint256 _incrementNumber, uint256 _startingPrice ) external onlyRole(DEFAULT_ADMIN_ROLE) { priceInc = _priceInc; incrementNumber = _incrementNumber; startingPrice = _startingPrice; } /** * @notice adds addresses into a whitelist * * @param addresses an array of addresses to add to whitelist */ function setWhiteList(address[] calldata addresses ) external onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i = 0; i < addresses.length; i++) { whiteList[addresses[i]] = true; } } /** * @notice returns true or false depending on */ function isWhitelisted() external view returns (bool) { return whiteList[msg.sender]; } /** * @notice returns the metadata uri for a given id * * @param _id the NFT id to return metadata for */ function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), "URI: nonexistent token"); return string(abi.encodePacked(super.uri(_id), Strings.toString(_id), ".json")); } }
/* * @title ERC1155 token for NFT Cheese * @author Nazariy Dumanskyy, Lem Canady */
Comment
editWindows
function editWindows( uint256 _publicWindowOpens, uint256 _whitelistWindowOpens ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _publicWindowOpens > _whitelistWindowOpens, "window combination not allowed" ); publicWindowOpens = _publicWindowOpens; whitelistWindowOpens = _whitelistWindowOpens; }
/** * @notice edit windows * * @param _publicWindowOpens UNIX timestamp for purchasing public window time * @param _whitelistWindowOpens UNIX timestamp for purchasing whitelist window time */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://322cf1e12fc4613d5b6be99d2da7163e6d3d01e08e1af01097d9a4bbfc44238d
{ "func_code_index": [ 3471, 3864 ] }
3,456
NFTCheese
contracts/NFTCheese.sol
0x1b603c18bc6766c0e6abcae9d83e8662d75b1b96
Solidity
NFTCheese
contract NFTCheese is AbstractERC1155Factory { uint256 public constant ARTWORK = 0; uint256 public _maxSupply = 333; uint256 public _reserved = 33; uint8 maxPerTx = 2; uint256 public whitelistWindowOpens = 1644523200; uint256 public publicWindowOpens = 1644609600; uint256 public priceInc = 100000000000000000; uint256 public incrementNumber= 50; uint256 public startingPrice = 50000000000000000; mapping(address => bool) private whiteList; mapping(address => uint256) public purchaseTxs; constructor( address[] memory _payees, uint256[] memory _shares, string memory _name, string memory _symbol, string memory _uri ) ERC1155(_uri) PaymentSplitter(_payees, _shares) { name_ = _name; symbol_ = _symbol; _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(DEFAULT_ADMIN_ROLE, 0x5DeD00BE946085E7a523803596706593DbF9959b); _mint(0x5DeD00BE946085E7a523803596706593DbF9959b, ARTWORK, 33, ""); } /** * @notice retrieve price for multiple NFTs * * @param amount the amount of NFTs to get price for */ function getPrice(uint256 amount) public view returns (uint256){ uint256 supply = totalSupply(ARTWORK) - _reserved; uint totalCost = 0; for (uint i = 0; i < amount; i++) { totalCost += getCurrentPriceAtPosition(supply + i); } return totalCost; } /** * @notice get price at position of the NFT token by ID * * @param position positiong to check the price at */ function getCurrentPriceAtPosition(uint256 position) public view returns (uint256){ uint256 multiplier = position/incrementNumber; uint256 priceIncrease = multiplier * priceInc; return priceIncrease + startingPrice; } /** * @notice purchase NFTs during whitelist mint * * @param amount the amount of cards to purchase */ function whitelistMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= whitelistWindowOpens, "Early access: window closed"); require(whiteList[msg.sender], "Sender not on the whitelist"); require(purchaseTxs[msg.sender] + amount <= maxPerTx, "Wallet mint limit"); mint(amount); } /** * @notice mint NFTs during public mint * * @param amount the amount of tokens to mint */ function publicMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= publicWindowOpens, "Purchase: window closed"); mint(amount); } /** * @notice global mint function used in early access and public sale * * @param amount the amount of tokens to mint */ function mint(uint256 amount) private { require(amount > 0, "Need to request at least 1 NFT"); require(totalSupply(ARTWORK) + amount <= _maxSupply, "Exceeds maximum supply"); require(msg.value >= getPrice(amount), "Not enough ETH sent, check price"); purchaseTxs[msg.sender] += amount; _mint(msg.sender, ARTWORK, amount, ""); } /** * @notice edit windows * * @param _publicWindowOpens UNIX timestamp for purchasing public window time * @param _whitelistWindowOpens UNIX timestamp for purchasing whitelist window time */ function editWindows( uint256 _publicWindowOpens, uint256 _whitelistWindowOpens ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _publicWindowOpens > _whitelistWindowOpens, "window combination not allowed" ); publicWindowOpens = _publicWindowOpens; whitelistWindowOpens = _whitelistWindowOpens; } /** * @notice edit mint settings * * @param _priceInc how much the price increments * @param _incrementNumber per how many tokens to increase price * @param _startingPrice starting price of the token */ function editMintSettings( uint256 _priceInc, uint256 _incrementNumber, uint256 _startingPrice ) external onlyRole(DEFAULT_ADMIN_ROLE) { priceInc = _priceInc; incrementNumber = _incrementNumber; startingPrice = _startingPrice; } /** * @notice adds addresses into a whitelist * * @param addresses an array of addresses to add to whitelist */ function setWhiteList(address[] calldata addresses ) external onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i = 0; i < addresses.length; i++) { whiteList[addresses[i]] = true; } } /** * @notice returns true or false depending on */ function isWhitelisted() external view returns (bool) { return whiteList[msg.sender]; } /** * @notice returns the metadata uri for a given id * * @param _id the NFT id to return metadata for */ function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), "URI: nonexistent token"); return string(abi.encodePacked(super.uri(_id), Strings.toString(_id), ".json")); } }
/* * @title ERC1155 token for NFT Cheese * @author Nazariy Dumanskyy, Lem Canady */
Comment
editMintSettings
function editMintSettings( uint256 _priceInc, uint256 _incrementNumber, uint256 _startingPrice ) external onlyRole(DEFAULT_ADMIN_ROLE) { priceInc = _priceInc; incrementNumber = _incrementNumber; startingPrice = _startingPrice; }
/** * @notice edit mint settings * * @param _priceInc how much the price increments * @param _incrementNumber per how many tokens to increase price * @param _startingPrice starting price of the token */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://322cf1e12fc4613d5b6be99d2da7163e6d3d01e08e1af01097d9a4bbfc44238d
{ "func_code_index": [ 4105, 4402 ] }
3,457
NFTCheese
contracts/NFTCheese.sol
0x1b603c18bc6766c0e6abcae9d83e8662d75b1b96
Solidity
NFTCheese
contract NFTCheese is AbstractERC1155Factory { uint256 public constant ARTWORK = 0; uint256 public _maxSupply = 333; uint256 public _reserved = 33; uint8 maxPerTx = 2; uint256 public whitelistWindowOpens = 1644523200; uint256 public publicWindowOpens = 1644609600; uint256 public priceInc = 100000000000000000; uint256 public incrementNumber= 50; uint256 public startingPrice = 50000000000000000; mapping(address => bool) private whiteList; mapping(address => uint256) public purchaseTxs; constructor( address[] memory _payees, uint256[] memory _shares, string memory _name, string memory _symbol, string memory _uri ) ERC1155(_uri) PaymentSplitter(_payees, _shares) { name_ = _name; symbol_ = _symbol; _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(DEFAULT_ADMIN_ROLE, 0x5DeD00BE946085E7a523803596706593DbF9959b); _mint(0x5DeD00BE946085E7a523803596706593DbF9959b, ARTWORK, 33, ""); } /** * @notice retrieve price for multiple NFTs * * @param amount the amount of NFTs to get price for */ function getPrice(uint256 amount) public view returns (uint256){ uint256 supply = totalSupply(ARTWORK) - _reserved; uint totalCost = 0; for (uint i = 0; i < amount; i++) { totalCost += getCurrentPriceAtPosition(supply + i); } return totalCost; } /** * @notice get price at position of the NFT token by ID * * @param position positiong to check the price at */ function getCurrentPriceAtPosition(uint256 position) public view returns (uint256){ uint256 multiplier = position/incrementNumber; uint256 priceIncrease = multiplier * priceInc; return priceIncrease + startingPrice; } /** * @notice purchase NFTs during whitelist mint * * @param amount the amount of cards to purchase */ function whitelistMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= whitelistWindowOpens, "Early access: window closed"); require(whiteList[msg.sender], "Sender not on the whitelist"); require(purchaseTxs[msg.sender] + amount <= maxPerTx, "Wallet mint limit"); mint(amount); } /** * @notice mint NFTs during public mint * * @param amount the amount of tokens to mint */ function publicMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= publicWindowOpens, "Purchase: window closed"); mint(amount); } /** * @notice global mint function used in early access and public sale * * @param amount the amount of tokens to mint */ function mint(uint256 amount) private { require(amount > 0, "Need to request at least 1 NFT"); require(totalSupply(ARTWORK) + amount <= _maxSupply, "Exceeds maximum supply"); require(msg.value >= getPrice(amount), "Not enough ETH sent, check price"); purchaseTxs[msg.sender] += amount; _mint(msg.sender, ARTWORK, amount, ""); } /** * @notice edit windows * * @param _publicWindowOpens UNIX timestamp for purchasing public window time * @param _whitelistWindowOpens UNIX timestamp for purchasing whitelist window time */ function editWindows( uint256 _publicWindowOpens, uint256 _whitelistWindowOpens ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _publicWindowOpens > _whitelistWindowOpens, "window combination not allowed" ); publicWindowOpens = _publicWindowOpens; whitelistWindowOpens = _whitelistWindowOpens; } /** * @notice edit mint settings * * @param _priceInc how much the price increments * @param _incrementNumber per how many tokens to increase price * @param _startingPrice starting price of the token */ function editMintSettings( uint256 _priceInc, uint256 _incrementNumber, uint256 _startingPrice ) external onlyRole(DEFAULT_ADMIN_ROLE) { priceInc = _priceInc; incrementNumber = _incrementNumber; startingPrice = _startingPrice; } /** * @notice adds addresses into a whitelist * * @param addresses an array of addresses to add to whitelist */ function setWhiteList(address[] calldata addresses ) external onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i = 0; i < addresses.length; i++) { whiteList[addresses[i]] = true; } } /** * @notice returns true or false depending on */ function isWhitelisted() external view returns (bool) { return whiteList[msg.sender]; } /** * @notice returns the metadata uri for a given id * * @param _id the NFT id to return metadata for */ function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), "URI: nonexistent token"); return string(abi.encodePacked(super.uri(_id), Strings.toString(_id), ".json")); } }
/* * @title ERC1155 token for NFT Cheese * @author Nazariy Dumanskyy, Lem Canady */
Comment
setWhiteList
function setWhiteList(address[] calldata addresses ) external onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i = 0; i < addresses.length; i++) { whiteList[addresses[i]] = true; } }
/** * @notice adds addresses into a whitelist * * @param addresses an array of addresses to add to whitelist */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://322cf1e12fc4613d5b6be99d2da7163e6d3d01e08e1af01097d9a4bbfc44238d
{ "func_code_index": [ 4542, 4760 ] }
3,458
NFTCheese
contracts/NFTCheese.sol
0x1b603c18bc6766c0e6abcae9d83e8662d75b1b96
Solidity
NFTCheese
contract NFTCheese is AbstractERC1155Factory { uint256 public constant ARTWORK = 0; uint256 public _maxSupply = 333; uint256 public _reserved = 33; uint8 maxPerTx = 2; uint256 public whitelistWindowOpens = 1644523200; uint256 public publicWindowOpens = 1644609600; uint256 public priceInc = 100000000000000000; uint256 public incrementNumber= 50; uint256 public startingPrice = 50000000000000000; mapping(address => bool) private whiteList; mapping(address => uint256) public purchaseTxs; constructor( address[] memory _payees, uint256[] memory _shares, string memory _name, string memory _symbol, string memory _uri ) ERC1155(_uri) PaymentSplitter(_payees, _shares) { name_ = _name; symbol_ = _symbol; _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(DEFAULT_ADMIN_ROLE, 0x5DeD00BE946085E7a523803596706593DbF9959b); _mint(0x5DeD00BE946085E7a523803596706593DbF9959b, ARTWORK, 33, ""); } /** * @notice retrieve price for multiple NFTs * * @param amount the amount of NFTs to get price for */ function getPrice(uint256 amount) public view returns (uint256){ uint256 supply = totalSupply(ARTWORK) - _reserved; uint totalCost = 0; for (uint i = 0; i < amount; i++) { totalCost += getCurrentPriceAtPosition(supply + i); } return totalCost; } /** * @notice get price at position of the NFT token by ID * * @param position positiong to check the price at */ function getCurrentPriceAtPosition(uint256 position) public view returns (uint256){ uint256 multiplier = position/incrementNumber; uint256 priceIncrease = multiplier * priceInc; return priceIncrease + startingPrice; } /** * @notice purchase NFTs during whitelist mint * * @param amount the amount of cards to purchase */ function whitelistMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= whitelistWindowOpens, "Early access: window closed"); require(whiteList[msg.sender], "Sender not on the whitelist"); require(purchaseTxs[msg.sender] + amount <= maxPerTx, "Wallet mint limit"); mint(amount); } /** * @notice mint NFTs during public mint * * @param amount the amount of tokens to mint */ function publicMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= publicWindowOpens, "Purchase: window closed"); mint(amount); } /** * @notice global mint function used in early access and public sale * * @param amount the amount of tokens to mint */ function mint(uint256 amount) private { require(amount > 0, "Need to request at least 1 NFT"); require(totalSupply(ARTWORK) + amount <= _maxSupply, "Exceeds maximum supply"); require(msg.value >= getPrice(amount), "Not enough ETH sent, check price"); purchaseTxs[msg.sender] += amount; _mint(msg.sender, ARTWORK, amount, ""); } /** * @notice edit windows * * @param _publicWindowOpens UNIX timestamp for purchasing public window time * @param _whitelistWindowOpens UNIX timestamp for purchasing whitelist window time */ function editWindows( uint256 _publicWindowOpens, uint256 _whitelistWindowOpens ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _publicWindowOpens > _whitelistWindowOpens, "window combination not allowed" ); publicWindowOpens = _publicWindowOpens; whitelistWindowOpens = _whitelistWindowOpens; } /** * @notice edit mint settings * * @param _priceInc how much the price increments * @param _incrementNumber per how many tokens to increase price * @param _startingPrice starting price of the token */ function editMintSettings( uint256 _priceInc, uint256 _incrementNumber, uint256 _startingPrice ) external onlyRole(DEFAULT_ADMIN_ROLE) { priceInc = _priceInc; incrementNumber = _incrementNumber; startingPrice = _startingPrice; } /** * @notice adds addresses into a whitelist * * @param addresses an array of addresses to add to whitelist */ function setWhiteList(address[] calldata addresses ) external onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i = 0; i < addresses.length; i++) { whiteList[addresses[i]] = true; } } /** * @notice returns true or false depending on */ function isWhitelisted() external view returns (bool) { return whiteList[msg.sender]; } /** * @notice returns the metadata uri for a given id * * @param _id the NFT id to return metadata for */ function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), "URI: nonexistent token"); return string(abi.encodePacked(super.uri(_id), Strings.toString(_id), ".json")); } }
/* * @title ERC1155 token for NFT Cheese * @author Nazariy Dumanskyy, Lem Canady */
Comment
isWhitelisted
function isWhitelisted() external view returns (bool) { return whiteList[msg.sender]; }
/** * @notice returns true or false depending on */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://322cf1e12fc4613d5b6be99d2da7163e6d3d01e08e1af01097d9a4bbfc44238d
{ "func_code_index": [ 4831, 4938 ] }
3,459
NFTCheese
contracts/NFTCheese.sol
0x1b603c18bc6766c0e6abcae9d83e8662d75b1b96
Solidity
NFTCheese
contract NFTCheese is AbstractERC1155Factory { uint256 public constant ARTWORK = 0; uint256 public _maxSupply = 333; uint256 public _reserved = 33; uint8 maxPerTx = 2; uint256 public whitelistWindowOpens = 1644523200; uint256 public publicWindowOpens = 1644609600; uint256 public priceInc = 100000000000000000; uint256 public incrementNumber= 50; uint256 public startingPrice = 50000000000000000; mapping(address => bool) private whiteList; mapping(address => uint256) public purchaseTxs; constructor( address[] memory _payees, uint256[] memory _shares, string memory _name, string memory _symbol, string memory _uri ) ERC1155(_uri) PaymentSplitter(_payees, _shares) { name_ = _name; symbol_ = _symbol; _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(DEFAULT_ADMIN_ROLE, 0x5DeD00BE946085E7a523803596706593DbF9959b); _mint(0x5DeD00BE946085E7a523803596706593DbF9959b, ARTWORK, 33, ""); } /** * @notice retrieve price for multiple NFTs * * @param amount the amount of NFTs to get price for */ function getPrice(uint256 amount) public view returns (uint256){ uint256 supply = totalSupply(ARTWORK) - _reserved; uint totalCost = 0; for (uint i = 0; i < amount; i++) { totalCost += getCurrentPriceAtPosition(supply + i); } return totalCost; } /** * @notice get price at position of the NFT token by ID * * @param position positiong to check the price at */ function getCurrentPriceAtPosition(uint256 position) public view returns (uint256){ uint256 multiplier = position/incrementNumber; uint256 priceIncrease = multiplier * priceInc; return priceIncrease + startingPrice; } /** * @notice purchase NFTs during whitelist mint * * @param amount the amount of cards to purchase */ function whitelistMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= whitelistWindowOpens, "Early access: window closed"); require(whiteList[msg.sender], "Sender not on the whitelist"); require(purchaseTxs[msg.sender] + amount <= maxPerTx, "Wallet mint limit"); mint(amount); } /** * @notice mint NFTs during public mint * * @param amount the amount of tokens to mint */ function publicMint(uint256 amount) external payable whenNotPaused { require(block.timestamp >= publicWindowOpens, "Purchase: window closed"); mint(amount); } /** * @notice global mint function used in early access and public sale * * @param amount the amount of tokens to mint */ function mint(uint256 amount) private { require(amount > 0, "Need to request at least 1 NFT"); require(totalSupply(ARTWORK) + amount <= _maxSupply, "Exceeds maximum supply"); require(msg.value >= getPrice(amount), "Not enough ETH sent, check price"); purchaseTxs[msg.sender] += amount; _mint(msg.sender, ARTWORK, amount, ""); } /** * @notice edit windows * * @param _publicWindowOpens UNIX timestamp for purchasing public window time * @param _whitelistWindowOpens UNIX timestamp for purchasing whitelist window time */ function editWindows( uint256 _publicWindowOpens, uint256 _whitelistWindowOpens ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _publicWindowOpens > _whitelistWindowOpens, "window combination not allowed" ); publicWindowOpens = _publicWindowOpens; whitelistWindowOpens = _whitelistWindowOpens; } /** * @notice edit mint settings * * @param _priceInc how much the price increments * @param _incrementNumber per how many tokens to increase price * @param _startingPrice starting price of the token */ function editMintSettings( uint256 _priceInc, uint256 _incrementNumber, uint256 _startingPrice ) external onlyRole(DEFAULT_ADMIN_ROLE) { priceInc = _priceInc; incrementNumber = _incrementNumber; startingPrice = _startingPrice; } /** * @notice adds addresses into a whitelist * * @param addresses an array of addresses to add to whitelist */ function setWhiteList(address[] calldata addresses ) external onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i = 0; i < addresses.length; i++) { whiteList[addresses[i]] = true; } } /** * @notice returns true or false depending on */ function isWhitelisted() external view returns (bool) { return whiteList[msg.sender]; } /** * @notice returns the metadata uri for a given id * * @param _id the NFT id to return metadata for */ function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), "URI: nonexistent token"); return string(abi.encodePacked(super.uri(_id), Strings.toString(_id), ".json")); } }
/* * @title ERC1155 token for NFT Cheese * @author Nazariy Dumanskyy, Lem Canady */
Comment
uri
function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), "URI: nonexistent token"); return string(abi.encodePacked(super.uri(_id), Strings.toString(_id), ".json")); }
/** * @notice returns the metadata uri for a given id * * @param _id the NFT id to return metadata for */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://322cf1e12fc4613d5b6be99d2da7163e6d3d01e08e1af01097d9a4bbfc44238d
{ "func_code_index": [ 5072, 5305 ] }
3,460
PALTRY
PALTRY.sol
0x0d0ab17e613b5afc16d89b8b5843875545de3dd1
Solidity
PALTRY
contract PALTRY is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { symbol = "PLT"; name = "PALTRY"; decimals = 18; _totalSupply = 75000000000000000000000; balances[0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a] = _totalSupply; emit Transfer(address(0), 0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a, _totalSupply); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; } // ------------------------------------------------------------------------ // Get the token balance for account tokenOwner // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // 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 // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(msg.sender, to, 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 double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, 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 // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account. The spender contract function // receiveApproval(...) is then executed // ------------------------------------------------------------------------ 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; } // ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } }
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
totalSupply
function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; }
// ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------
LineComment
v0.4.26+commit.4563c3fc
None
bzzr://bb6ab4bc82a4967c68eef85109f46897b3f3e0f4543dc707a46be1a05480b282
{ "func_code_index": [ 971, 1092 ] }
3,461
PALTRY
PALTRY.sol
0x0d0ab17e613b5afc16d89b8b5843875545de3dd1
Solidity
PALTRY
contract PALTRY is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { symbol = "PLT"; name = "PALTRY"; decimals = 18; _totalSupply = 75000000000000000000000; balances[0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a] = _totalSupply; emit Transfer(address(0), 0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a, _totalSupply); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; } // ------------------------------------------------------------------------ // Get the token balance for account tokenOwner // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // 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 // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(msg.sender, to, 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 double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, 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 // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account. The spender contract function // receiveApproval(...) is then executed // ------------------------------------------------------------------------ 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; } // ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } }
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
balanceOf
function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; }
// ------------------------------------------------------------------------ // Get the token balance for account tokenOwner // ------------------------------------------------------------------------
LineComment
v0.4.26+commit.4563c3fc
None
bzzr://bb6ab4bc82a4967c68eef85109f46897b3f3e0f4543dc707a46be1a05480b282
{ "func_code_index": [ 1312, 1441 ] }
3,462
PALTRY
PALTRY.sol
0x0d0ab17e613b5afc16d89b8b5843875545de3dd1
Solidity
PALTRY
contract PALTRY is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { symbol = "PLT"; name = "PALTRY"; decimals = 18; _totalSupply = 75000000000000000000000; balances[0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a] = _totalSupply; emit Transfer(address(0), 0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a, _totalSupply); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; } // ------------------------------------------------------------------------ // Get the token balance for account tokenOwner // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // 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 // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(msg.sender, to, 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 double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, 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 // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account. The spender contract function // receiveApproval(...) is then executed // ------------------------------------------------------------------------ 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; } // ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } }
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
transfer
function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], 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.26+commit.4563c3fc
None
bzzr://bb6ab4bc82a4967c68eef85109f46897b3f3e0f4543dc707a46be1a05480b282
{ "func_code_index": [ 1785, 2067 ] }
3,463
PALTRY
PALTRY.sol
0x0d0ab17e613b5afc16d89b8b5843875545de3dd1
Solidity
PALTRY
contract PALTRY is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { symbol = "PLT"; name = "PALTRY"; decimals = 18; _totalSupply = 75000000000000000000000; balances[0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a] = _totalSupply; emit Transfer(address(0), 0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a, _totalSupply); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; } // ------------------------------------------------------------------------ // Get the token balance for account tokenOwner // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // 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 // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(msg.sender, to, 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 double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, 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 // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account. The spender contract function // receiveApproval(...) is then executed // ------------------------------------------------------------------------ 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; } // ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } }
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
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 double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------
LineComment
v0.4.26+commit.4563c3fc
None
bzzr://bb6ab4bc82a4967c68eef85109f46897b3f3e0f4543dc707a46be1a05480b282
{ "func_code_index": [ 2575, 2788 ] }
3,464
PALTRY
PALTRY.sol
0x0d0ab17e613b5afc16d89b8b5843875545de3dd1
Solidity
PALTRY
contract PALTRY is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { symbol = "PLT"; name = "PALTRY"; decimals = 18; _totalSupply = 75000000000000000000000; balances[0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a] = _totalSupply; emit Transfer(address(0), 0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a, _totalSupply); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; } // ------------------------------------------------------------------------ // Get the token balance for account tokenOwner // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // 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 // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(msg.sender, to, 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 double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, 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 // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account. The spender contract function // receiveApproval(...) is then executed // ------------------------------------------------------------------------ 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; } // ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } }
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
transferFrom
function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], 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 // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------
LineComment
v0.4.26+commit.4563c3fc
None
bzzr://bb6ab4bc82a4967c68eef85109f46897b3f3e0f4543dc707a46be1a05480b282
{ "func_code_index": [ 3319, 3682 ] }
3,465
PALTRY
PALTRY.sol
0x0d0ab17e613b5afc16d89b8b5843875545de3dd1
Solidity
PALTRY
contract PALTRY is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { symbol = "PLT"; name = "PALTRY"; decimals = 18; _totalSupply = 75000000000000000000000; balances[0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a] = _totalSupply; emit Transfer(address(0), 0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a, _totalSupply); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; } // ------------------------------------------------------------------------ // Get the token balance for account tokenOwner // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // 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 // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(msg.sender, to, 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 double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, 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 // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account. The spender contract function // receiveApproval(...) is then executed // ------------------------------------------------------------------------ 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; } // ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } }
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
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.26+commit.4563c3fc
None
bzzr://bb6ab4bc82a4967c68eef85109f46897b3f3e0f4543dc707a46be1a05480b282
{ "func_code_index": [ 3965, 4121 ] }
3,466
PALTRY
PALTRY.sol
0x0d0ab17e613b5afc16d89b8b5843875545de3dd1
Solidity
PALTRY
contract PALTRY is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { symbol = "PLT"; name = "PALTRY"; decimals = 18; _totalSupply = 75000000000000000000000; balances[0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a] = _totalSupply; emit Transfer(address(0), 0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a, _totalSupply); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; } // ------------------------------------------------------------------------ // Get the token balance for account tokenOwner // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // 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 // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(msg.sender, to, 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 double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, 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 // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account. The spender contract function // receiveApproval(...) is then executed // ------------------------------------------------------------------------ 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; } // ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } }
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
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.26+commit.4563c3fc
None
bzzr://bb6ab4bc82a4967c68eef85109f46897b3f3e0f4543dc707a46be1a05480b282
{ "func_code_index": [ 4476, 4798 ] }
3,467
PALTRY
PALTRY.sol
0x0d0ab17e613b5afc16d89b8b5843875545de3dd1
Solidity
PALTRY
contract PALTRY is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { symbol = "PLT"; name = "PALTRY"; decimals = 18; _totalSupply = 75000000000000000000000; balances[0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a] = _totalSupply; emit Transfer(address(0), 0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a, _totalSupply); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; } // ------------------------------------------------------------------------ // Get the token balance for account tokenOwner // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // 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 // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(msg.sender, to, 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 double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, 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 // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account. The spender contract function // receiveApproval(...) is then executed // ------------------------------------------------------------------------ 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; } // ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } }
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
function () public payable { revert(); }
// ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------
LineComment
v0.4.26+commit.4563c3fc
None
bzzr://bb6ab4bc82a4967c68eef85109f46897b3f3e0f4543dc707a46be1a05480b282
{ "func_code_index": [ 4990, 5049 ] }
3,468
PALTRY
PALTRY.sol
0x0d0ab17e613b5afc16d89b8b5843875545de3dd1
Solidity
PALTRY
contract PALTRY is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { symbol = "PLT"; name = "PALTRY"; decimals = 18; _totalSupply = 75000000000000000000000; balances[0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a] = _totalSupply; emit Transfer(address(0), 0xBEAA4020F8346fbDB503b17C0f5EfCDbBae95A6a, _totalSupply); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; } // ------------------------------------------------------------------------ // Get the token balance for account tokenOwner // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // 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 // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(msg.sender, to, 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 double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, 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 // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account. The spender contract function // receiveApproval(...) is then executed // ------------------------------------------------------------------------ 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; } // ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } }
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
transferAnyERC20Token
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); }
// ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------
LineComment
v0.4.26+commit.4563c3fc
None
bzzr://bb6ab4bc82a4967c68eef85109f46897b3f3e0f4543dc707a46be1a05480b282
{ "func_code_index": [ 5282, 5471 ] }
3,469
AaveImport
contracts/interfaces/ILendingPool.sol
0x751961666d8605af1c5ee549205f822f47b04168
Solidity
ILendingPool
abstract contract ILendingPool { function flashLoan( address payable _receiver, address _reserve, uint _amount, bytes calldata _params) external virtual; function deposit(address _reserve, uint256 _amount, uint16 _referralCode) external virtual payable; function setUserUseReserveAsCollateral(address _reserve, bool _useAsCollateral) external virtual; function borrow(address _reserve, uint256 _amount, uint256 _interestRateMode, uint16 _referralCode) external virtual; function repay( address _reserve, uint256 _amount, address payable _onBehalfOf) external virtual payable; function swapBorrowRateMode(address _reserve) external virtual; function getReserves() external virtual view returns(address[] memory); /// @param _reserve underlying token address function getReserveData(address _reserve) external virtual view returns ( uint256 totalLiquidity, // reserve total liquidity uint256 availableLiquidity, // reserve available liquidity for borrowing uint256 totalBorrowsStable, // total amount of outstanding borrows at Stable rate uint256 totalBorrowsVariable, // total amount of outstanding borrows at Variable rate uint256 liquidityRate, // current deposit APY of the reserve for depositors, in Ray units. uint256 variableBorrowRate, // current variable rate APY of the reserve pool, in Ray units. uint256 stableBorrowRate, // current stable rate APY of the reserve pool, in Ray units. uint256 averageStableBorrowRate, // current average stable borrow rate uint256 utilizationRate, // expressed as total borrows/total liquidity. uint256 liquidityIndex, // cumulative liquidity index uint256 variableBorrowIndex, // cumulative variable borrow index address aTokenAddress, // aTokens contract address for the specific _reserve uint40 lastUpdateTimestamp // timestamp of the last update of reserve data ); /// @param _user users address function getUserAccountData(address _user) external virtual view returns ( uint256 totalLiquidityETH, // user aggregated deposits across all the reserves. In Wei uint256 totalCollateralETH, // user aggregated collateral across all the reserves. In Wei uint256 totalBorrowsETH, // user aggregated outstanding borrows across all the reserves. In Wei uint256 totalFeesETH, // user aggregated current outstanding fees in ETH. In Wei uint256 availableBorrowsETH, // user available amount to borrow in ETH uint256 currentLiquidationThreshold, // user current average liquidation threshold across all the collaterals deposited uint256 ltv, // user average Loan-to-Value between all the collaterals uint256 healthFactor // user current Health Factor ); /// @param _reserve underlying token address /// @param _user users address function getUserReserveData(address _reserve, address _user) external virtual view returns ( uint256 currentATokenBalance, // user current reserve aToken balance uint256 currentBorrowBalance, // user current reserve outstanding borrow balance uint256 principalBorrowBalance, // user balance of borrowed asset uint256 borrowRateMode, // user borrow rate mode either Stable or Variable uint256 borrowRate, // user current borrow rate APY uint256 liquidityRate, // user current earn rate on _reserve uint256 originationFee, // user outstanding loan origination fee uint256 variableBorrowIndex, // user variable cumulative index uint256 lastUpdateTimestamp, // Timestamp of the last data update bool usageAsCollateralEnabled // Whether the user's current reserve is enabled as a collateral ); function getReserveConfigurationData(address _reserve) external virtual view returns ( uint256 ltv, uint256 liquidationThreshold, uint256 liquidationBonus, address rateStrategyAddress, bool usageAsCollateralEnabled, bool borrowingEnabled, bool stableBorrowRateEnabled, bool isActive ); // ------------------ LendingPoolCoreData ------------------------ function getReserveATokenAddress(address _reserve) public virtual view returns (address); function getReserveConfiguration(address _reserve) external virtual view returns (uint256, uint256, uint256, bool); function getUserUnderlyingAssetBalance(address _reserve, address _user) public virtual view returns (uint256); function getReserveCurrentLiquidityRate(address _reserve) public virtual view returns (uint256); function getReserveCurrentVariableBorrowRate(address _reserve) public virtual view returns (uint256); function getReserveCurrentStableBorrowRate(address _reserve) public virtual view returns (uint256); function getReserveTotalLiquidity(address _reserve) public virtual view returns (uint256); function getReserveAvailableLiquidity(address _reserve) public virtual view returns (uint256); function getReserveTotalBorrowsVariable(address _reserve) public virtual view returns (uint256); // ---------------- LendingPoolDataProvider --------------------- function calculateUserGlobalData(address _user) public virtual view returns ( uint256 totalLiquidityBalanceETH, uint256 totalCollateralBalanceETH, uint256 totalBorrowBalanceETH, uint256 totalFeesETH, uint256 currentLtv, uint256 currentLiquidationThreshold, uint256 healthFactor, bool healthFactorBelowThreshold ); }
getReserveData
function getReserveData(address _reserve) external virtual view returns ( uint256 totalLiquidity, // reserve total liquidity uint256 availableLiquidity, // reserve available liquidity for borrowing uint256 totalBorrowsStable, // total amount of outstanding borrows at Stable rate uint256 totalBorrowsVariable, // total amount of outstanding borrows at Variable rate uint256 liquidityRate, // current deposit APY of the reserve for depositors, in Ray units. uint256 variableBorrowRate, // current variable rate APY of the reserve pool, in Ray units. uint256 stableBorrowRate, // current stable rate APY of the reserve pool, in Ray units. uint256 averageStableBorrowRate, // current average stable borrow rate uint256 utilizationRate, // expressed as total borrows/total liquidity. uint256 liquidityIndex, // cumulative liquidity index uint256 variableBorrowIndex, // cumulative variable borrow index address aTokenAddress, // aTokens contract address for the specific _reserve uint40 lastUpdateTimestamp // timestamp of the last update of reserve data );
/// @param _reserve underlying token address
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09
{ "func_code_index": [ 778, 2169 ] }
3,470
AaveImport
contracts/interfaces/ILendingPool.sol
0x751961666d8605af1c5ee549205f822f47b04168
Solidity
ILendingPool
abstract contract ILendingPool { function flashLoan( address payable _receiver, address _reserve, uint _amount, bytes calldata _params) external virtual; function deposit(address _reserve, uint256 _amount, uint16 _referralCode) external virtual payable; function setUserUseReserveAsCollateral(address _reserve, bool _useAsCollateral) external virtual; function borrow(address _reserve, uint256 _amount, uint256 _interestRateMode, uint16 _referralCode) external virtual; function repay( address _reserve, uint256 _amount, address payable _onBehalfOf) external virtual payable; function swapBorrowRateMode(address _reserve) external virtual; function getReserves() external virtual view returns(address[] memory); /// @param _reserve underlying token address function getReserveData(address _reserve) external virtual view returns ( uint256 totalLiquidity, // reserve total liquidity uint256 availableLiquidity, // reserve available liquidity for borrowing uint256 totalBorrowsStable, // total amount of outstanding borrows at Stable rate uint256 totalBorrowsVariable, // total amount of outstanding borrows at Variable rate uint256 liquidityRate, // current deposit APY of the reserve for depositors, in Ray units. uint256 variableBorrowRate, // current variable rate APY of the reserve pool, in Ray units. uint256 stableBorrowRate, // current stable rate APY of the reserve pool, in Ray units. uint256 averageStableBorrowRate, // current average stable borrow rate uint256 utilizationRate, // expressed as total borrows/total liquidity. uint256 liquidityIndex, // cumulative liquidity index uint256 variableBorrowIndex, // cumulative variable borrow index address aTokenAddress, // aTokens contract address for the specific _reserve uint40 lastUpdateTimestamp // timestamp of the last update of reserve data ); /// @param _user users address function getUserAccountData(address _user) external virtual view returns ( uint256 totalLiquidityETH, // user aggregated deposits across all the reserves. In Wei uint256 totalCollateralETH, // user aggregated collateral across all the reserves. In Wei uint256 totalBorrowsETH, // user aggregated outstanding borrows across all the reserves. In Wei uint256 totalFeesETH, // user aggregated current outstanding fees in ETH. In Wei uint256 availableBorrowsETH, // user available amount to borrow in ETH uint256 currentLiquidationThreshold, // user current average liquidation threshold across all the collaterals deposited uint256 ltv, // user average Loan-to-Value between all the collaterals uint256 healthFactor // user current Health Factor ); /// @param _reserve underlying token address /// @param _user users address function getUserReserveData(address _reserve, address _user) external virtual view returns ( uint256 currentATokenBalance, // user current reserve aToken balance uint256 currentBorrowBalance, // user current reserve outstanding borrow balance uint256 principalBorrowBalance, // user balance of borrowed asset uint256 borrowRateMode, // user borrow rate mode either Stable or Variable uint256 borrowRate, // user current borrow rate APY uint256 liquidityRate, // user current earn rate on _reserve uint256 originationFee, // user outstanding loan origination fee uint256 variableBorrowIndex, // user variable cumulative index uint256 lastUpdateTimestamp, // Timestamp of the last data update bool usageAsCollateralEnabled // Whether the user's current reserve is enabled as a collateral ); function getReserveConfigurationData(address _reserve) external virtual view returns ( uint256 ltv, uint256 liquidationThreshold, uint256 liquidationBonus, address rateStrategyAddress, bool usageAsCollateralEnabled, bool borrowingEnabled, bool stableBorrowRateEnabled, bool isActive ); // ------------------ LendingPoolCoreData ------------------------ function getReserveATokenAddress(address _reserve) public virtual view returns (address); function getReserveConfiguration(address _reserve) external virtual view returns (uint256, uint256, uint256, bool); function getUserUnderlyingAssetBalance(address _reserve, address _user) public virtual view returns (uint256); function getReserveCurrentLiquidityRate(address _reserve) public virtual view returns (uint256); function getReserveCurrentVariableBorrowRate(address _reserve) public virtual view returns (uint256); function getReserveCurrentStableBorrowRate(address _reserve) public virtual view returns (uint256); function getReserveTotalLiquidity(address _reserve) public virtual view returns (uint256); function getReserveAvailableLiquidity(address _reserve) public virtual view returns (uint256); function getReserveTotalBorrowsVariable(address _reserve) public virtual view returns (uint256); // ---------------- LendingPoolDataProvider --------------------- function calculateUserGlobalData(address _user) public virtual view returns ( uint256 totalLiquidityBalanceETH, uint256 totalCollateralBalanceETH, uint256 totalBorrowBalanceETH, uint256 totalFeesETH, uint256 currentLtv, uint256 currentLiquidationThreshold, uint256 healthFactor, bool healthFactorBelowThreshold ); }
getUserAccountData
function getUserAccountData(address _user) external virtual view returns ( uint256 totalLiquidityETH, // user aggregated deposits across all the reserves. In Wei uint256 totalCollateralETH, // user aggregated collateral across all the reserves. In Wei uint256 totalBorrowsETH, // user aggregated outstanding borrows across all the reserves. In Wei uint256 totalFeesETH, // user aggregated current outstanding fees in ETH. In Wei uint256 availableBorrowsETH, // user available amount to borrow in ETH uint256 currentLiquidationThreshold, // user current average liquidation threshold across all the collaterals deposited uint256 ltv, // user average Loan-to-Value between all the collaterals uint256 healthFactor // user current Health Factor );
/// @param _user users address
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09
{ "func_code_index": [ 2206, 3184 ] }
3,471
AaveImport
contracts/interfaces/ILendingPool.sol
0x751961666d8605af1c5ee549205f822f47b04168
Solidity
ILendingPool
abstract contract ILendingPool { function flashLoan( address payable _receiver, address _reserve, uint _amount, bytes calldata _params) external virtual; function deposit(address _reserve, uint256 _amount, uint16 _referralCode) external virtual payable; function setUserUseReserveAsCollateral(address _reserve, bool _useAsCollateral) external virtual; function borrow(address _reserve, uint256 _amount, uint256 _interestRateMode, uint16 _referralCode) external virtual; function repay( address _reserve, uint256 _amount, address payable _onBehalfOf) external virtual payable; function swapBorrowRateMode(address _reserve) external virtual; function getReserves() external virtual view returns(address[] memory); /// @param _reserve underlying token address function getReserveData(address _reserve) external virtual view returns ( uint256 totalLiquidity, // reserve total liquidity uint256 availableLiquidity, // reserve available liquidity for borrowing uint256 totalBorrowsStable, // total amount of outstanding borrows at Stable rate uint256 totalBorrowsVariable, // total amount of outstanding borrows at Variable rate uint256 liquidityRate, // current deposit APY of the reserve for depositors, in Ray units. uint256 variableBorrowRate, // current variable rate APY of the reserve pool, in Ray units. uint256 stableBorrowRate, // current stable rate APY of the reserve pool, in Ray units. uint256 averageStableBorrowRate, // current average stable borrow rate uint256 utilizationRate, // expressed as total borrows/total liquidity. uint256 liquidityIndex, // cumulative liquidity index uint256 variableBorrowIndex, // cumulative variable borrow index address aTokenAddress, // aTokens contract address for the specific _reserve uint40 lastUpdateTimestamp // timestamp of the last update of reserve data ); /// @param _user users address function getUserAccountData(address _user) external virtual view returns ( uint256 totalLiquidityETH, // user aggregated deposits across all the reserves. In Wei uint256 totalCollateralETH, // user aggregated collateral across all the reserves. In Wei uint256 totalBorrowsETH, // user aggregated outstanding borrows across all the reserves. In Wei uint256 totalFeesETH, // user aggregated current outstanding fees in ETH. In Wei uint256 availableBorrowsETH, // user available amount to borrow in ETH uint256 currentLiquidationThreshold, // user current average liquidation threshold across all the collaterals deposited uint256 ltv, // user average Loan-to-Value between all the collaterals uint256 healthFactor // user current Health Factor ); /// @param _reserve underlying token address /// @param _user users address function getUserReserveData(address _reserve, address _user) external virtual view returns ( uint256 currentATokenBalance, // user current reserve aToken balance uint256 currentBorrowBalance, // user current reserve outstanding borrow balance uint256 principalBorrowBalance, // user balance of borrowed asset uint256 borrowRateMode, // user borrow rate mode either Stable or Variable uint256 borrowRate, // user current borrow rate APY uint256 liquidityRate, // user current earn rate on _reserve uint256 originationFee, // user outstanding loan origination fee uint256 variableBorrowIndex, // user variable cumulative index uint256 lastUpdateTimestamp, // Timestamp of the last data update bool usageAsCollateralEnabled // Whether the user's current reserve is enabled as a collateral ); function getReserveConfigurationData(address _reserve) external virtual view returns ( uint256 ltv, uint256 liquidationThreshold, uint256 liquidationBonus, address rateStrategyAddress, bool usageAsCollateralEnabled, bool borrowingEnabled, bool stableBorrowRateEnabled, bool isActive ); // ------------------ LendingPoolCoreData ------------------------ function getReserveATokenAddress(address _reserve) public virtual view returns (address); function getReserveConfiguration(address _reserve) external virtual view returns (uint256, uint256, uint256, bool); function getUserUnderlyingAssetBalance(address _reserve, address _user) public virtual view returns (uint256); function getReserveCurrentLiquidityRate(address _reserve) public virtual view returns (uint256); function getReserveCurrentVariableBorrowRate(address _reserve) public virtual view returns (uint256); function getReserveCurrentStableBorrowRate(address _reserve) public virtual view returns (uint256); function getReserveTotalLiquidity(address _reserve) public virtual view returns (uint256); function getReserveAvailableLiquidity(address _reserve) public virtual view returns (uint256); function getReserveTotalBorrowsVariable(address _reserve) public virtual view returns (uint256); // ---------------- LendingPoolDataProvider --------------------- function calculateUserGlobalData(address _user) public virtual view returns ( uint256 totalLiquidityBalanceETH, uint256 totalCollateralBalanceETH, uint256 totalBorrowBalanceETH, uint256 totalFeesETH, uint256 currentLtv, uint256 currentLiquidationThreshold, uint256 healthFactor, bool healthFactorBelowThreshold ); }
getUserReserveData
function getUserReserveData(address _reserve, address _user) external virtual view returns ( uint256 currentATokenBalance, // user current reserve aToken balance uint256 currentBorrowBalance, // user current reserve outstanding borrow balance uint256 principalBorrowBalance, // user balance of borrowed asset uint256 borrowRateMode, // user borrow rate mode either Stable or Variable uint256 borrowRate, // user current borrow rate APY uint256 liquidityRate, // user current earn rate on _reserve uint256 originationFee, // user outstanding loan origination fee uint256 variableBorrowIndex, // user variable cumulative index uint256 lastUpdateTimestamp, // Timestamp of the last data update bool usageAsCollateralEnabled // Whether the user's current reserve is enabled as a collateral );
/// @param _reserve underlying token address /// @param _user users address
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09
{ "func_code_index": [ 3270, 4319 ] }
3,472
AaveImport
contracts/interfaces/ILendingPool.sol
0x751961666d8605af1c5ee549205f822f47b04168
Solidity
ILendingPool
abstract contract ILendingPool { function flashLoan( address payable _receiver, address _reserve, uint _amount, bytes calldata _params) external virtual; function deposit(address _reserve, uint256 _amount, uint16 _referralCode) external virtual payable; function setUserUseReserveAsCollateral(address _reserve, bool _useAsCollateral) external virtual; function borrow(address _reserve, uint256 _amount, uint256 _interestRateMode, uint16 _referralCode) external virtual; function repay( address _reserve, uint256 _amount, address payable _onBehalfOf) external virtual payable; function swapBorrowRateMode(address _reserve) external virtual; function getReserves() external virtual view returns(address[] memory); /// @param _reserve underlying token address function getReserveData(address _reserve) external virtual view returns ( uint256 totalLiquidity, // reserve total liquidity uint256 availableLiquidity, // reserve available liquidity for borrowing uint256 totalBorrowsStable, // total amount of outstanding borrows at Stable rate uint256 totalBorrowsVariable, // total amount of outstanding borrows at Variable rate uint256 liquidityRate, // current deposit APY of the reserve for depositors, in Ray units. uint256 variableBorrowRate, // current variable rate APY of the reserve pool, in Ray units. uint256 stableBorrowRate, // current stable rate APY of the reserve pool, in Ray units. uint256 averageStableBorrowRate, // current average stable borrow rate uint256 utilizationRate, // expressed as total borrows/total liquidity. uint256 liquidityIndex, // cumulative liquidity index uint256 variableBorrowIndex, // cumulative variable borrow index address aTokenAddress, // aTokens contract address for the specific _reserve uint40 lastUpdateTimestamp // timestamp of the last update of reserve data ); /// @param _user users address function getUserAccountData(address _user) external virtual view returns ( uint256 totalLiquidityETH, // user aggregated deposits across all the reserves. In Wei uint256 totalCollateralETH, // user aggregated collateral across all the reserves. In Wei uint256 totalBorrowsETH, // user aggregated outstanding borrows across all the reserves. In Wei uint256 totalFeesETH, // user aggregated current outstanding fees in ETH. In Wei uint256 availableBorrowsETH, // user available amount to borrow in ETH uint256 currentLiquidationThreshold, // user current average liquidation threshold across all the collaterals deposited uint256 ltv, // user average Loan-to-Value between all the collaterals uint256 healthFactor // user current Health Factor ); /// @param _reserve underlying token address /// @param _user users address function getUserReserveData(address _reserve, address _user) external virtual view returns ( uint256 currentATokenBalance, // user current reserve aToken balance uint256 currentBorrowBalance, // user current reserve outstanding borrow balance uint256 principalBorrowBalance, // user balance of borrowed asset uint256 borrowRateMode, // user borrow rate mode either Stable or Variable uint256 borrowRate, // user current borrow rate APY uint256 liquidityRate, // user current earn rate on _reserve uint256 originationFee, // user outstanding loan origination fee uint256 variableBorrowIndex, // user variable cumulative index uint256 lastUpdateTimestamp, // Timestamp of the last data update bool usageAsCollateralEnabled // Whether the user's current reserve is enabled as a collateral ); function getReserveConfigurationData(address _reserve) external virtual view returns ( uint256 ltv, uint256 liquidationThreshold, uint256 liquidationBonus, address rateStrategyAddress, bool usageAsCollateralEnabled, bool borrowingEnabled, bool stableBorrowRateEnabled, bool isActive ); // ------------------ LendingPoolCoreData ------------------------ function getReserveATokenAddress(address _reserve) public virtual view returns (address); function getReserveConfiguration(address _reserve) external virtual view returns (uint256, uint256, uint256, bool); function getUserUnderlyingAssetBalance(address _reserve, address _user) public virtual view returns (uint256); function getReserveCurrentLiquidityRate(address _reserve) public virtual view returns (uint256); function getReserveCurrentVariableBorrowRate(address _reserve) public virtual view returns (uint256); function getReserveCurrentStableBorrowRate(address _reserve) public virtual view returns (uint256); function getReserveTotalLiquidity(address _reserve) public virtual view returns (uint256); function getReserveAvailableLiquidity(address _reserve) public virtual view returns (uint256); function getReserveTotalBorrowsVariable(address _reserve) public virtual view returns (uint256); // ---------------- LendingPoolDataProvider --------------------- function calculateUserGlobalData(address _user) public virtual view returns ( uint256 totalLiquidityBalanceETH, uint256 totalCollateralBalanceETH, uint256 totalBorrowBalanceETH, uint256 totalFeesETH, uint256 currentLtv, uint256 currentLiquidationThreshold, uint256 healthFactor, bool healthFactorBelowThreshold ); }
getReserveATokenAddress
function getReserveATokenAddress(address _reserve) public virtual view returns (address);
// ------------------ LendingPoolCoreData ------------------------
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09
{ "func_code_index": [ 4807, 4900 ] }
3,473
AaveImport
contracts/interfaces/ILendingPool.sol
0x751961666d8605af1c5ee549205f822f47b04168
Solidity
ILendingPool
abstract contract ILendingPool { function flashLoan( address payable _receiver, address _reserve, uint _amount, bytes calldata _params) external virtual; function deposit(address _reserve, uint256 _amount, uint16 _referralCode) external virtual payable; function setUserUseReserveAsCollateral(address _reserve, bool _useAsCollateral) external virtual; function borrow(address _reserve, uint256 _amount, uint256 _interestRateMode, uint16 _referralCode) external virtual; function repay( address _reserve, uint256 _amount, address payable _onBehalfOf) external virtual payable; function swapBorrowRateMode(address _reserve) external virtual; function getReserves() external virtual view returns(address[] memory); /// @param _reserve underlying token address function getReserveData(address _reserve) external virtual view returns ( uint256 totalLiquidity, // reserve total liquidity uint256 availableLiquidity, // reserve available liquidity for borrowing uint256 totalBorrowsStable, // total amount of outstanding borrows at Stable rate uint256 totalBorrowsVariable, // total amount of outstanding borrows at Variable rate uint256 liquidityRate, // current deposit APY of the reserve for depositors, in Ray units. uint256 variableBorrowRate, // current variable rate APY of the reserve pool, in Ray units. uint256 stableBorrowRate, // current stable rate APY of the reserve pool, in Ray units. uint256 averageStableBorrowRate, // current average stable borrow rate uint256 utilizationRate, // expressed as total borrows/total liquidity. uint256 liquidityIndex, // cumulative liquidity index uint256 variableBorrowIndex, // cumulative variable borrow index address aTokenAddress, // aTokens contract address for the specific _reserve uint40 lastUpdateTimestamp // timestamp of the last update of reserve data ); /// @param _user users address function getUserAccountData(address _user) external virtual view returns ( uint256 totalLiquidityETH, // user aggregated deposits across all the reserves. In Wei uint256 totalCollateralETH, // user aggregated collateral across all the reserves. In Wei uint256 totalBorrowsETH, // user aggregated outstanding borrows across all the reserves. In Wei uint256 totalFeesETH, // user aggregated current outstanding fees in ETH. In Wei uint256 availableBorrowsETH, // user available amount to borrow in ETH uint256 currentLiquidationThreshold, // user current average liquidation threshold across all the collaterals deposited uint256 ltv, // user average Loan-to-Value between all the collaterals uint256 healthFactor // user current Health Factor ); /// @param _reserve underlying token address /// @param _user users address function getUserReserveData(address _reserve, address _user) external virtual view returns ( uint256 currentATokenBalance, // user current reserve aToken balance uint256 currentBorrowBalance, // user current reserve outstanding borrow balance uint256 principalBorrowBalance, // user balance of borrowed asset uint256 borrowRateMode, // user borrow rate mode either Stable or Variable uint256 borrowRate, // user current borrow rate APY uint256 liquidityRate, // user current earn rate on _reserve uint256 originationFee, // user outstanding loan origination fee uint256 variableBorrowIndex, // user variable cumulative index uint256 lastUpdateTimestamp, // Timestamp of the last data update bool usageAsCollateralEnabled // Whether the user's current reserve is enabled as a collateral ); function getReserveConfigurationData(address _reserve) external virtual view returns ( uint256 ltv, uint256 liquidationThreshold, uint256 liquidationBonus, address rateStrategyAddress, bool usageAsCollateralEnabled, bool borrowingEnabled, bool stableBorrowRateEnabled, bool isActive ); // ------------------ LendingPoolCoreData ------------------------ function getReserveATokenAddress(address _reserve) public virtual view returns (address); function getReserveConfiguration(address _reserve) external virtual view returns (uint256, uint256, uint256, bool); function getUserUnderlyingAssetBalance(address _reserve, address _user) public virtual view returns (uint256); function getReserveCurrentLiquidityRate(address _reserve) public virtual view returns (uint256); function getReserveCurrentVariableBorrowRate(address _reserve) public virtual view returns (uint256); function getReserveCurrentStableBorrowRate(address _reserve) public virtual view returns (uint256); function getReserveTotalLiquidity(address _reserve) public virtual view returns (uint256); function getReserveAvailableLiquidity(address _reserve) public virtual view returns (uint256); function getReserveTotalBorrowsVariable(address _reserve) public virtual view returns (uint256); // ---------------- LendingPoolDataProvider --------------------- function calculateUserGlobalData(address _user) public virtual view returns ( uint256 totalLiquidityBalanceETH, uint256 totalCollateralBalanceETH, uint256 totalBorrowBalanceETH, uint256 totalFeesETH, uint256 currentLtv, uint256 currentLiquidationThreshold, uint256 healthFactor, bool healthFactorBelowThreshold ); }
calculateUserGlobalData
function calculateUserGlobalData(address _user) public virtual view returns ( uint256 totalLiquidityBalanceETH, uint256 totalCollateralBalanceETH, uint256 totalBorrowBalanceETH, uint256 totalFeesETH, uint256 currentLtv, uint256 currentLiquidationThreshold, uint256 healthFactor, bool healthFactorBelowThreshold );
// ---------------- LendingPoolDataProvider ---------------------
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09
{ "func_code_index": [ 6007, 6452 ] }
3,474
ACrowdsale
ACrowdsale.sol
0x05ef5be2983f8091a57433938bb5d17612e11268
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) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } }
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
transfer
function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; }
/** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://643e48b89c3533ebf696f8469c67db2e071b058340421a94093f6f2eb3b7a5be
{ "func_code_index": [ 270, 509 ] }
3,475
ACrowdsale
ACrowdsale.sol
0x05ef5be2983f8091a57433938bb5d17612e11268
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) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } }
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
balanceOf
function balanceOf(address _owner) constant 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.26+commit.4563c3fc
Apache-2.0
bzzr://643e48b89c3533ebf696f8469c67db2e071b058340421a94093f6f2eb3b7a5be
{ "func_code_index": [ 715, 824 ] }
3,476
ACrowdsale
ACrowdsale.sol
0x05ef5be2983f8091a57433938bb5d17612e11268
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) 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 amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @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 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } }
/** * @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) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; }
/** * @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 amout of tokens to be transfered */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://643e48b89c3533ebf696f8469c67db2e071b058340421a94093f6f2eb3b7a5be
{ "func_code_index": [ 388, 891 ] }
3,477
ACrowdsale
ACrowdsale.sol
0x05ef5be2983f8091a57433938bb5d17612e11268
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) 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 amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @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 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } }
/** * @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) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; }
/** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://643e48b89c3533ebf696f8469c67db2e071b058340421a94093f6f2eb3b7a5be
{ "func_code_index": [ 1126, 1674 ] }
3,478
ACrowdsale
ACrowdsale.sol
0x05ef5be2983f8091a57433938bb5d17612e11268
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) 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 amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @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 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } }
/** * @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) constant returns (uint256 remaining) { 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 specifing the amount of tokens still available for the spender. */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://643e48b89c3533ebf696f8469c67db2e071b058340421a94093f6f2eb3b7a5be
{ "func_code_index": [ 1997, 2135 ] }
3,479
ACrowdsale
ACrowdsale.sol
0x05ef5be2983f8091a57433938bb5d17612e11268
Solidity
Ownable
contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); owner = newOwner; } }
/** * @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() { owner = msg.sender; }
/** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://643e48b89c3533ebf696f8469c67db2e071b058340421a94093f6f2eb3b7a5be
{ "func_code_index": [ 169, 222 ] }
3,480
ACrowdsale
ACrowdsale.sol
0x05ef5be2983f8091a57433938bb5d17612e11268
Solidity
Ownable
contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); owner = newOwner; } }
/** * @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) onlyOwner { require(newOwner != address(0)); 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.26+commit.4563c3fc
Apache-2.0
bzzr://643e48b89c3533ebf696f8469c67db2e071b058340421a94093f6f2eb3b7a5be
{ "func_code_index": [ 541, 666 ] }
3,481
ACrowdsale
ACrowdsale.sol
0x05ef5be2983f8091a57433938bb5d17612e11268
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 will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) public onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public onlyOwner returns (bool) { mintingFinished = true; emit MintFinished(); return true; } }
/** * @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) public onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); return true; }
/** * @dev Function to mint tokens * @param _to The address that will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://643e48b89c3533ebf696f8469c67db2e071b058340421a94093f6f2eb3b7a5be
{ "func_code_index": [ 485, 720 ] }
3,482
ACrowdsale
ACrowdsale.sol
0x05ef5be2983f8091a57433938bb5d17612e11268
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 will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) public onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public onlyOwner returns (bool) { mintingFinished = true; emit MintFinished(); return true; } }
/** * @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() public onlyOwner returns (bool) { mintingFinished = true; emit MintFinished(); return true; }
/** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://643e48b89c3533ebf696f8469c67db2e071b058340421a94093f6f2eb3b7a5be
{ "func_code_index": [ 837, 976 ] }
3,483
ACrowdsale
ACrowdsale.sol
0x05ef5be2983f8091a57433938bb5d17612e11268
Solidity
ACrowdsale
contract ACrowdsale is Ownable{ uint sat = 1e18; // *** Config *** // Token string name ="utrade.cash"; string symbol = "UTRD"; uint32 decimals = 18; // ICO uint start = 1599062400; uint period = 12 hours; uint maxSellingInICO = 140 * sat; uint256 coinsAfterIcoAmountTeam = 110 * sat; uint total = 500 * sat; // Block tokens uint partsAmountToTeam = 5; uint periodUnBlock = 1 weeks; // --- Config --- // Config dependences uint256 leftTokensAmountToTeamBlocked = 0; uint256 everyPeriodUnblockAmount = 0; uint nextUnblockUnix = start + period + periodUnBlock; address owner; address me = address(this); bool isFinished = false; bool isPreIco = true; uint icoSellingAmount = 0; uint capInICO = 0; mapping (address => uint) private influences; ERC20_Token public token = new ERC20_Token(name, symbol, decimals); constructor() public { owner = msg.sender; createInfluencesFirst(); token.mint(me, total); // mint totalSupply to ICO_contract token.finishMinting(); // close minting tokens. Only <total> supply. } function() external payable { uint amount = msg.value; checkValidMsg(amount); transferICO(amount); } function checkValidMsg(uint amount){ if(isFinished){revert("ICO is CLOSED");} if(now < start || ICOtimeLeftMinsICO() <= 0){revert("ICO interval error");} if(!(influences[msg.sender] > 0)){revert("Address not found in whitelists");} if(maxSellingInICO <= icoSellingAmount){revert("Ico tokens run out");} if(influences[msg.sender] < (msg.value + token.balanceOf(msg.sender))){revert("Your limit has been exceeded");} if(amount != 1 * sat && amount != 2 * sat && amount != 3 * sat){revert("Integer token only");} } function transferICO(uint amount){ token.transfer(msg.sender, amount); icoSellingAmount += amount; if(icoSellingAmount >= maxSellingInICO){ closeICO(); } } function ICOtimeLeftMinsICO() public view returns (int256) { return int256(start) + int256(period) - int256(now); } function createInfluencesFirst() private { setInfluenece(0x7015E9C7e1e5c77Bff80Fe24A9b4F09436F4a729, 1); setInfluenece(0x46775b2583502dbe0f594C725C5944543f19682b, 2); setInfluenece(0x731966E2D7BE010F61FeBFdad9300b88105aBD10, 2); setInfluenece(0x38bbe82f6D16FB4538a389766a72C180F02E2C62, 2); setInfluenece(0x8F70b3aC45A6896532FB90B992D5B7827bA88d3C, 2); setInfluenece(0x475E5FbE12DA0C0b16EF7690172de84bdF75c105, 2); setInfluenece(0x29d6D6D84c9662486198667B5a9fbda3E698b23f, 2); setInfluenece(0xCCa178a04D83Af193330C7927fb9a42212Fb1C25, 2); setInfluenece(0x5D9E720a1c16B98ab897165803C4D96E8060b8E4, 2); setInfluenece(0x1d436c04aA4875866A14d124171eb3cB8564077b, 2); setInfluenece(0xc05062409B9768eD3Bd7b7cf19B46223C43647b7, 2); setInfluenece(0x7aE3869e4341B63a5bC54BA956Cc1D1eA6a09aa8, 2); setInfluenece(0xD26867ceb87f09674A5EF63f6b32b3cA5B89834C, 2); setInfluenece(0x5978aB98214eB021a5Ca763cCAc0c43a7e335d24, 2); setInfluenece(0x5598B05c9DE624cCAdc469fB6EBb8eF7EF95C3E0, 2); setInfluenece(0xa4985fD2F781f1716109cD3FF6e68D718B01C5fD, 2); setInfluenece(0x9Ae673c304EA6A4c2E5bf1E1A14D21d8696fAE2D, 2); setInfluenece(0xF44666a64167c7685Faa98C2E87Bee7ED145acb9, 2); setInfluenece(0x9dd21593E675048916d377fe28D1cb04B29a51C6, 2); setInfluenece(0xc62785b58724D744B843e479D76D47897E61Ca7e, 2); setInfluenece(0x0FBbCB08fc99f3402148c20017D9572Fb9205deE, 1); setInfluenece(0x84670177112E04cd2bDe4884f23C345CCCc12D9b, 1); setInfluenece(0xCA3989447c3858d8f69A42263134C3121644998C, 1); } function createInfluencesSecond() public onlyOwner { setInfluenece(0x308e2feC61005Dc01571b14ead4f1734E1070300, 1); setInfluenece(0xA50d9221452b0E8d8FeD126b4Ac8F8e4f3144553, 1); setInfluenece(0xF5ABB5f3Ec53A7304447b0F47E25406B1AaAa66e, 1); setInfluenece(0x928220Dd02606186BF03eB9EDDE989De97fd461e, 1); setInfluenece(0x735636618A390a769853ea07Bc13447683d2015C, 1); setInfluenece(0x5449A630D69375E2A7308ab375EAa5802B2C1bB3, 1); setInfluenece(0x6DCd311Cb7454f2656897d7b714bA0B909BC2622, 1); setInfluenece(0x657D7888f5b88c636aE7796075327cF5970623D9, 1); setInfluenece(0x42D455B219214FDA88aF47786CC6e3B5f9a19c37, 1); setInfluenece(0x81aa6141923ea42fcaa763d9857418224d9b025a, 1); setInfluenece(0x4a0573F70E77A28dd079C0e079174135Ab6B41c5, 1); setInfluenece(0x383BB8E06c838F2822477d5c8ebCd59d35a74E65, 1); setInfluenece(0x99A2fFEaF83acb11FFa9EE76821648cE96B29De0, 1); setInfluenece(0x4Ff5867b278c3650aAE0a9f264531Bd14036CD15, 1); setInfluenece(0x33f144Aa851e9e55b042f46014bb4F737Bc777BF, 1); setInfluenece(0x624C878f8097B26b3ef42adAf5f26E38854E5E90, 1); setInfluenece(0x9c08D7bB1493F3A8e26761D5363bDF1Bd7901Fb5, 1); setInfluenece(0x0c936869E30B0a7893897c3dA9555d44D2A0A1A2, 1); setInfluenece(0x4aD330E8B16BCb8546f99239e1E4D95280C93226, 1); setInfluenece(0xD6a6027D168cE1f8036D8d01c2918F8Cb610271b, 1); setInfluenece(0xBA682E593784f7654e4F92D58213dc495f229Eec, 1); setInfluenece(0x72ddC9807B1616e65777CC69f73ECc33C2925a83, 1); setInfluenece(0x6927DdbA18dca7B978a4B6f4334fAFFBd6bA3c94, 1); setInfluenece(0x88e21d089101632F086794Efb63E6E799865D7CC, 1); setInfluenece(0x346d7C121A5089ded561Fed4E7fABBBcffB6406C, 1); setInfluenece(0x4b1bA9aA4337e65ffA2155b92BaFd8E177E73CB5, 1); setInfluenece(0x2C7121dCbd8e2288cd3E181D2C3B2477527C3e81, 1); setInfluenece(0x847Eaa8E0a808305b00305DA61b875Dd2Ca3FbAc, 1); setInfluenece(0x7257b76281C2E2b4b04a6e2ab867928535C32041, 1); setInfluenece(0x0C745F54d6CC5aC370B296A3610a325307F568cC, 1); setInfluenece(0x24Ad08d9589D96152AcC5452fb212Bd291BbB06C, 1); setInfluenece(0x12042A785b8D3D9f8b24FDbEdd0c11B2B35dCFCE, 1); setInfluenece(0x5D9E720a1c16B98ab897165803C4D96E8060b8E4, 1); setInfluenece(0x986058cb8e7558d53f790d678f0f3696a328f5a3, 1); setInfluenece(0x5A1255d306BcdC140F42df5bE5140b0F3E95C4D3, 1); setInfluenece(0xEF505053cd6015a09029F274c42A7DCF5a9Cc795, 1); setInfluenece(0x57E55a3a3e3361E9480f9C0f4132c9AD72Ccd3E7, 1); setInfluenece(0xF1c0Aa21577a81E455Fedf81c3b3ba26552d5d1f, 1); setInfluenece(0x9ABAe20Af4afbd7BA2b78a4db34Dc4210390aAB4, 1); setInfluenece(0x05552F4D5D4ba2D583A363b0372b5ebC4499f7Aa, 1); setInfluenece(0x3a331AeAca46790817403340f909c10f77140104, 1); setInfluenece(0x11414661E194b8b0D7248E789c1d41332904f2bA, 1); setInfluenece(0xb98c26531A4FB84D5AB1778df9771A59A720adDA, 1); setInfluenece(0xbAfb40bd711eD1C864dF95055FBd6f82c0F3F0c0, 1); setInfluenece(0x24BA7f4547fe5d3EBec6041C7080E264C989580B, 1); setInfluenece(0xfce0413BAD4E59f55946669E678EccFe87777777, 1); setInfluenece(0x731C48ceDBC3E96b7BEbF976dFCb0C633C177ec2, 1); setInfluenece(0xBDECcDb60C2962AbaD2AbD3f28c7b5BC6B468022, 1); setInfluenece(0xAcb272Eac895FA57394747615fCb068b8858AAF2, 1); setInfluenece(0xd1c299B36d6Cb2c19Af6d441dA6ea98402Bd3536, 1); setInfluenece(0x78eadF65FB7f9738d566a71002f245fc39f6Eaa5, 1); setInfluenece(0x1d436c04aA4875866A14d124171eb3cB8564077b, 1); setInfluenece(0xD39eFeaC6dEB8C00e228E04953DA9AA0Ff572B25, 1); setInfluenece(0xAfB3dC27B39E4979802e95750E5d4a679c30a182, 1); setInfluenece(0x31E985b4f7af6B479148d260309B7BcEcEF0fa7B, 1); setInfluenece(0xFCd3086ccf0817BFF780f45e4070d7DB5530506d, 1); setInfluenece(0x477Bf09DDB3049c1265f6E11FD33267c1D74D901, 1); setInfluenece(0x61543790F9D85284c16b36c15dAb02Fb975CA38B, 1); setInfluenece(0xA9f72Bc6511630Ac118f351C7144a8a5060765C5, 1); setInfluenece(0xB75B4a9e80f335e102c45C188BFed10cFDB10BbF, 1); setInfluenece(0x74c229C733244676CC81F4A7d5BCDbFE98C02A10, 1); setInfluenece(0x897853510D7fb160045122934110a3197E0DF2DF, 1); setInfluenece(0xAeC6B35e91ce4878Bc556810dD659dABA5c00530, 1); setInfluenece(0x9dcD2A7b3FB0EF1705437441deE74f691447Bb36, 1); setInfluenece(0x9Df9E4D06ebBD5381dd3b561B52BfE2CE0788Ed8, 1); setInfluenece(0x09127c9f1aF963f06b643B966BAf6A1700DAa38F, 1); setInfluenece(0x2488f090656BddB63fe3Bdb506D0D109AaaD93Bb, 1); setInfluenece(0x0147d4286a65fbad86102263b2468dd06f06c9f8, 1); setInfluenece(0xA94b40c53432f0576E64873CE1CEAd1aae62Fc90, 1); setInfluenece(0xd108480f40cd5D9FC08c9F64919d801BE88aC86d, 1); setInfluenece(0xB14df4544D6FD08E55Be8bF96a6745cDDD47e80f, 1); setInfluenece(0xfDEd54FE11500A6FE983A2f37669e5323eCEE40d, 1); setInfluenece(0x1e8df76D0DfE06b351c0B58C35E28A1Cb93595e4, 1); setInfluenece(0xc55175f8BE83D0477713a5B9f64aC4b82438cA5A, 1); setInfluenece(0x8f43dE6EE8644C43D46254c919E5B00BcbdaA7B4, 1); setInfluenece(0xDa892C1700147079d0bDeafB7b566E77315f98A4, 1); setInfluenece(0x08D6f4Ca2D5bA6ec96F14B6BfaF9312Ff3FE8BE1, 1); setInfluenece(0x4b1bA9aA4337e65ffA2155b92BaFd8E177E73CB5, 1); setInfluenece(0x7563f9f3951851ce0089b8a3293bb177c41abe73, 1); setInfluenece(0x80ba68D6E7AC418e717467C38E6587EAA74a84b4, 1); setInfluenece(0xD837c32efB8D93C151C13b5a558531DEf5FF84f1, 1); setInfluenece(0xb9890DCcb98A6737Bd8d370146709D99904Ac123, 1); setInfluenece(0xd61366B8a5E140765297039d9449Dc7a6D07A3AB, 1); setInfluenece(0x57DEf117605A239cF2feDe21C7e14818C2376710, 1); setInfluenece(0xDa892C1700147079d0bDeafB7b566E77315f98A4, 1); setInfluenece(0xd2Fb5EAd3cA3644F70a1D17B89e40B9769c58D9c, 1); setInfluenece(0xBB181B1BD9ECb002c9b2Ff3356261F4F02ECfE12, 1); setInfluenece(0xe78A6F195a04969E9e1E68E92B72e38e7b1ae21A, 1); setInfluenece(0xb68c2f299D391C900e5C0c92027aC3cF3dC21188, 1); setInfluenece(0x50946E16bE370726eb7Bb3b98ADD977887cC8BE2, 2); setInfluenece(0xc1bb29ee5f546eb85780dbfe1027234287bc6f61, 1); setInfluenece(0x9fcf9B0A90Dbfe291421B65B249bCDc710cb8Fc0, 1); setInfluenece(0xe599125686200c27964BC6Db2C32e838321d91d3, 1); setInfluenece(0x1D496C150e4f8443058A6AFA090F442349E3f664, 1); setInfluenece(0x49A3D1Fc6f2fA558882B774De4760D79fFF06Ed3, 1); setInfluenece(0xee1BeBEa20aA68BA6f3B706B05cF19bf61210137, 1); setInfluenece(0x76B4b27B47f211448964eD2cf92F731412602700, 1); setInfluenece(0xCd0D4CDb238Eec15Fcf4ff9d13d5a59051E507D7, 1); setInfluenece(0x85c7D244c6057D42C770aD85aE198Fc5F47957fC, 1); setInfluenece(0x8f76516Df6Ca5AF18cdc176f55FC0E85d73d49Fc, 1); setInfluenece(0xbe05a4e64d947621FfE87ecD2Ae94578746b44b6, 1); setInfluenece(0x4A14B8A7C64C50e6DcF6E9BE71045322C7ad0479, 1); setInfluenece(0x5e4F13110a329d3E8f575Da56ED3689311F78C3f, 1); setInfluenece(0x572Ce5Fc4495278a5f5fe0e6975d96EE5B7097AD, 1); setInfluenece(0x011152ADCCe81034c7A9bb0cD7060b0865C871E7, 1); setInfluenece(0xE31f159dC48466312A63B0Cab5C01833dA185C51, 1); setInfluenece(0x9Ae74b7582A451b4b0564380AeFDf9e7a418F3f6, 1); setInfluenece(0x49522Dc3C008FE3A3a26a70569f6fa0B86Ae70E2, 1); setInfluenece(0x305995b71109D53b2CFa1F9f3952A54274fE818d, 1); setInfluenece(0x43D2e66971D96dDA47C476f5141a13DaC48cC9D3, 1); setInfluenece(0xDfd748eAb0F32c6056b63F83df85FF9EE050918a, 1); setInfluenece(0x87eD35c08D4aF834350879f062cC02064C17B421, 1); setInfluenece(0xD0436Abe9F371851CB76C8c5fFBA3c5520B44a54, 1); setInfluenece(0x7c359032a39E5E9D4680553E1256291FDe65cfaD, 1); setInfluenece(0x20a4937AD3143a79Aa3C9DA639e0130a5984a1f6, 1); setInfluenece(0x0BE74e970B209ce27Ee1C5d1924D3D422287088f, 1); setInfluenece(0x37f48060490EEADcE18Da8965139b4Af6AC1b3C6, 1); setInfluenece(0x252bc4533a551878E4b6354b6c0E38A1fd311713, 1); setInfluenece(0xb0DC5932E4C277f1eCac227AA629E04B9614c917, 1); setInfluenece(0x0De69e83Ba189689067AA64939cbAfE5c98f507e, 1); setInfluenece(0x7A166f2Fe92551d6058777367634aC0D471c9C80, 1); setInfluenece(0xa9903C6C0489d0eaDaf310088955bABd2607E87D, 1); setInfluenece(0xe9b4F7755F74bE4389f54e07c94d1541e27c2f33, 1); setInfluenece(0x306bF96102eBE58579dff7b3C3c54DC360BdDB30, 1); setInfluenece(0xDc6B8B33630FAdE4a11d5f52666a4c30Ac800363, 1); setInfluenece(0x5926A1534A8AFb400c806e4C21e2bBbee4a023b8, 1); setInfluenece(0x891E8ebd0430Ab4360b7B74996C2AEe650A960d9, 1); setInfluenece(0x27Be743f13d892B9CF55ae3Ef9997BF533C05aF8, 1); setInfluenece(0xA5b936cD0f1731748d59C74E9510D8046b1a08ac, 1); setInfluenece(0xae479FFEba84b5Dd5fBD81E4d4958a3cAEd7a08a, 1); setInfluenece(0xa985ECe5F6468C2857fAa62a23E9551d342f8813, 1); setInfluenece(0x4F1c6872B0da93bAC1e13C0b27f15863b798F905, 1); setInfluenece(0x1d453eBD3a30ED9897c9CeA5AAeFcdc00928c418, 1); setInfluenece(0x072A96d5f54eB25A81B06cD4D2a5BCc2203Be388, 1); setInfluenece(0x6a8Ef41601cE5498f577ce4c433846246754a1af, 1); setInfluenece(0x6d54EAb8814F5515a3360E1774A1a3CE211Fa5d4, 1); setInfluenece(0x323D65b33DEabdD13637e31e938C802B19f703ba, 1); setInfluenece(0x60575aE40bbf646AfAA9154d87674dbbF365A458, 1); setInfluenece(0xe2Eb79E6C6B478b46f4c12736D5b004b952E99c8, 1); setInfluenece(0x9C5Dd910FBB6de08A3806E894d260F88F990Feaf, 1); setInfluenece(0x9B55108f9D9C4E4bFfb4895e3033293aFCD4FA0d, 1); setInfluenece(0x476E366f170B2563ae1AaA68533B9623Da2d3BFE, 1); setInfluenece(0x1f19f9ffdc7f8c71c6b09d7c7349f0932229d401, 1); setInfluenece(0xc32f4f415a4de14f36180a1b67463459c49fd087, 1); setInfluenece(0xb412B96Dbe138DA98be8e475f632E1A8F0037748, 1); setInfluenece(0xa583944170F9fE5B7e60d20FA1315eF3AFCab6F9, 1); setInfluenece(0x6f07C85494ccF426c71e2B651ac4c71d7758a927, 1); setInfluenece(0xB9069e74869d3577d956b230c86F32620E4bF9a2, 1); setInfluenece(0xF1Ee6Eedc0C62fD2DfF153cc017733035cAc7C63, 1); setInfluenece(0xAfADB4763b17a16044E231399469d59e7D3c76A5, 1); setInfluenece(0x5B1b75427Bf32E32e0A601159C70Bf3101aD4228, 1); setInfluenece(0x01647edfd56e7ff582046626760fcbfa67cd730a, 1); setInfluenece(0x165E631b7e81Ea7D1Cee086506f9927d51927e3E, 1); setInfluenece(0xBCaccD141800Eb17A75B1967d52c6D3F6ab0AFfE, 1); setInfluenece(0x48c7D866455700611F124685c80110848cE32dD1, 1); setInfluenece(0xA4eea4Cf6a8e8603C95df7B058a08AF945d2A581, 1); setInfluenece(0xecbc7b98f1199b908803524f28a9b00bc5e4a4b2, 1); setInfluenece(0x01FeD7F61B379ad59D86a8f5B7A6edb95eBa3134, 1); setInfluenece(0xe01a23A71715D4c50A210C4FDeeBa97cFE1Ffb69, 1); setInfluenece(0x470d2c3f820421fAf7ADa94bF8DCfB6C6Ae1Ad91, 1); setInfluenece(0x6769737CACf3848C45E35b0B7351aBaB3c8273C1, 1); setInfluenece(0x8c11f8bC26D656D2f9953c1c0Dfb6d33175C3bea, 1); setInfluenece(0x1E70Be098b27846f0880b09dF9815dE0855E95A6, 1); setInfluenece(0x210A5d5d5971ad689F31B00426bb2FfF5a7da82F, 1); setInfluenece(0xFF63Ee71A7AfC1d36Eb60669eE4105cFB8064095, 1); setInfluenece(0x5B4d2B0c80b063f3e0922619AFa532a1AA410d06, 1); setInfluenece(0xf4CfE4452C38C8C62a72eD8F09D0a5667F231c28, 1); setInfluenece(0xf4CfE4452C38C8C62a72eD8F09D0a5667F231c28, 1); setInfluenece(0x5bA3EeD97C38473239cE0D0b674BeCACB0967f66, 1); setInfluenece(0xF56B186BF3267ba89DA1F362Cf76B3E8e9149daE, 1); setInfluenece(0x670C843B8b3DB24290Df89EbF05ce58E1b7b039A, 1); setInfluenece(0x763a0A26FbFaa15C37aE663f14ae465F78670837, 1); setInfluenece(0x2281ce5EA91e5a236aDb91039d28e4f70a717C01, 1); setInfluenece(0xD0f7458c7960f94446B7992E4C588eeA961aDAeE, 1); setInfluenece(0xa2044Fe01d17709662068E24ec3d766713608c1D, 1); setInfluenece(0xe69eD750187a1f92348A3Fbfd704331b353EA511, 1); setInfluenece(0x3dF72C5B92eA4549D77ec800FFaB38dC7ae5A6B4, 1); setInfluenece(0x9e8d49A606E252e251a02FF82Eab5a6C8C0f07E0, 1); setInfluenece(0xDB84275BC3fD83eeCDd58ce2C2dF7DB1BA23eeEd, 1); setInfluenece(0xd8EC8EdE99AF3adb8a25eCD7Ee17BdABC2c2326E, 1); setInfluenece(0x8452bB062d554f374b68D58D8406fdf7C7cE5994, 1); setInfluenece(0x98A97D1E73FAaabEdD29E6439f77e45DC0174471, 1); setInfluenece(0x38C160bC49Ab7e03913AAb72e88DF5CB9aF6AA9F, 1); setInfluenece(0xa46fAf198Fc3a6dE196dB8E36761EdFf02a9CA8B, 1); } function setInfluenece(address addr, uint amount) public onlyOwner { influences[addr] = amount * sat; capInICO += amount; } function closeICO() private { isFinished = true; token.transfer(owner, coinsAfterIcoAmountTeam); leftTokensAmountToTeamBlocked = total - coinsAfterIcoAmountTeam - icoSellingAmount; everyPeriodUnblockAmount = leftTokensAmountToTeamBlocked / partsAmountToTeam; } function nextUnblockSentTeamTokens() public onlyOwner { require(nextUnblockUnix < now, "nextUnblockUnix is not now"); require(leftTokensAmountToTeamBlocked > 0, "leftTokensAmountToTeamBlocked = 0"); if(token.balanceOf(me) < everyPeriodUnblockAmount){ everyPeriodUnblockAmount = token.balanceOf(me); } token.transfer(owner, everyPeriodUnblockAmount); nextUnblockUnix = now + periodUnBlock; leftTokensAmountToTeamBlocked -= everyPeriodUnblockAmount; } function getETH() public onlyOwner payable { owner.transfer(me.balance); } function manualCloseIco(uint pass) onlyOwner public{ require(pass == 5 && ICOtimeLeftMinsICO() <= 0 && !isFinished, "Require ICOtimeLeftMinsICO"); closeICO(); } function totalSupplyToken() public view returns (uint balance){ return token.totalSupply() / sat; } // Development utils function myBalance() public view returns (uint balance){ return token.balanceOf(msg.sender) / sat; } function showIsFinished() public view returns (bool){ return isFinished; } function showIsfinishMinting() public view returns (bool){ return token.mintingFinished(); } function getIcoETH() public view returns (uint){ return me.balance; } function geLefttTokensAmountToTeamBlocked() public view returns (uint){ return leftTokensAmountToTeamBlocked / sat; } function getNextUnblockUnixMins() public view returns (uint){ return nextUnblockUnix - now; } function getCapInICO() public view returns (uint){ return capInICO; } function getLeftToStart() public view returns (uint){ return (start - now) / 1 minutes; } function getInfluencerAmount(address addr) public view returns (uint){ return influences[addr] / sat; } function getIcoSellingAmount() public view returns (uint){ return icoSellingAmount / sat; } }
myBalance
function myBalance() public view returns (uint balance){ return token.balanceOf(msg.sender) / sat; }
// Development utils
LineComment
v0.4.26+commit.4563c3fc
Apache-2.0
bzzr://643e48b89c3533ebf696f8469c67db2e071b058340421a94093f6f2eb3b7a5be
{ "func_code_index": [ 18545, 18664 ] }
3,484
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 94, 154 ] }
3,485
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 235, 308 ] }
3,486
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
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.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 530, 612 ] }
3,487
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
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.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 889, 977 ] }
3,488
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
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 * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 1639, 1718 ] }
3,489
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
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.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 2029, 2131 ] }
3,490
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 259, 445 ] }
3,491
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 721, 862 ] }
3,492
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 1158, 1353 ] }
3,493
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; }
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 1605, 2077 ] }
3,494
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 2546, 2683 ] }
3,495
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
div
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 3172, 3453 ] }
3,496
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 3911, 4046 ] }
3,497
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
mod
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 4524, 4695 ] }
3,498
MuskFinance
MuskFinance.sol
0x2e843a93998935022e52b6b94877dd1660467f74
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
isContract
function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); }
/** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://6255a7e7511730f9230d0fc910a1aba6e96a6dd74abb3683f87858ee265769f9
{ "func_code_index": [ 606, 1230 ] }
3,499