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
VeraCoin
VeraCoin.sol
0xf90f1648926005a8bb3ed8ec883164de7f768743
Solidity
Haltable
contract Haltable is Ownable { bool public halted; modifier stopInEmergency { require(!halted); _; } modifier onlyInEmergency { require(halted); _; } // called by the owner on emergency, triggers stopped state function halt() external onlyOwner { halted = true; } // called by the owner on end of emergency, returns to normal state function unhalt() external onlyOwner onlyInEmergency { halted = false; } }
/* * Haltable * * Abstract contract that allows children to implement an * emergency stop mechanism. Differs from Pausable by causing a throw when in halt mode. * * * Originally envisioned in FirstBlood ICO contract. */
Comment
unhalt
function unhalt() external onlyOwner onlyInEmergency { halted = false; }
// called by the owner on end of emergency, returns to normal state
LineComment
v0.4.16+commit.d7661dd9
bzzr://1f27e8465532873eb3888aa6ff655b1a02573d4be9906245de4351d19e9f1da1
{ "func_code_index": [ 431, 522 ] }
59,461
VeraCoin
VeraCoin.sol
0xf90f1648926005a8bb3ed8ec883164de7f768743
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.16+commit.d7661dd9
bzzr://1f27e8465532873eb3888aa6ff655b1a02573d4be9906245de4351d19e9f1da1
{ "func_code_index": [ 283, 542 ] }
59,462
VeraCoin
VeraCoin.sol
0xf90f1648926005a8bb3ed8ec883164de7f768743
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.16+commit.d7661dd9
bzzr://1f27e8465532873eb3888aa6ff655b1a02573d4be9906245de4351d19e9f1da1
{ "func_code_index": [ 758, 875 ] }
59,463
VeraCoin
VeraCoin.sol
0xf90f1648926005a8bb3ed8ec883164de7f768743
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 avaible 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.16+commit.d7661dd9
bzzr://1f27e8465532873eb3888aa6ff655b1a02573d4be9906245de4351d19e9f1da1
{ "func_code_index": [ 404, 943 ] }
59,464
VeraCoin
VeraCoin.sol
0xf90f1648926005a8bb3ed8ec883164de7f768743
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 avaible 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.16+commit.d7661dd9
bzzr://1f27e8465532873eb3888aa6ff655b1a02573d4be9906245de4351d19e9f1da1
{ "func_code_index": [ 1188, 1772 ] }
59,465
VeraCoin
VeraCoin.sol
0xf90f1648926005a8bb3ed8ec883164de7f768743
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 avaible 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 avaible for the spender. */
NatSpecMultiLine
v0.4.16+commit.d7661dd9
bzzr://1f27e8465532873eb3888aa6ff655b1a02573d4be9906245de4351d19e9f1da1
{ "func_code_index": [ 2105, 2251 ] }
59,466
VeraCoin
VeraCoin.sol
0xf90f1648926005a8bb3ed8ec883164de7f768743
Solidity
VeraCoin
contract VeraCoin is StandardToken { string public name = "VeraCoin"; string public symbol = "Vera"; uint256 public decimals = 18; uint256 public INITIAL_SUPPLY = 15700000 * 1 ether; /** * @dev Contructor that gives msg.sender all of existing tokens. */ function VeraCoin() { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } }
/** * @title VeraCoin * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * Note they can later distribute these tokens as they wish using `transfer` and other * `StandardToken` functions. */
NatSpecMultiLine
VeraCoin
function VeraCoin() { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; }
/** * @dev Contructor that gives msg.sender all of existing tokens. */
NatSpecMultiLine
v0.4.16+commit.d7661dd9
bzzr://1f27e8465532873eb3888aa6ff655b1a02573d4be9906245de4351d19e9f1da1
{ "func_code_index": [ 300, 420 ] }
59,467
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
transferDAOownership
function transferDAOownership(address payable _daoAddress) external;
/// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 330, 400 ] }
59,468
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
createNewCollection
function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external;
/// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn]
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 1109, 1324 ] }
59,469
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
addCollectible
function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external;
/// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 1959, 2167 ] }
59,470
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
bulkAddCollectible
function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external;
/// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 2762, 2984 ] }
59,471
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
mintPack
function mintPack(uint256 cID) external payable;
/// @notice Mints an NFT with random token ID /// @param cID Collection ID
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 3313, 3363 ] }
59,472
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
bulkMintPack
function bulkMintPack(uint256 cID, uint256 amount) external payable;
/// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 3490, 3560 ] }
59,473
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
mintPassClaimed
function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool);
/// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 3686, 3772 ] }
59,474
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
tokensClaimable
function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory);
/// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 3931, 4028 ] }
59,475
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
remainingTokens
function remainingTokens(uint256 cID) external view returns (uint256);
/// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 4120, 4192 ] }
59,476
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
updateMetadata
function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external;
/// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 4478, 4593 ] }
59,477
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
addVersion
function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external;
/// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 4802, 4890 ] }
59,478
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
addNewLicense
function addNewLicense(uint256 cID, string memory _license) external;
/// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 5389, 5460 ] }
59,479
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
getLicense
function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory);
/// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 5597, 5693 ] }
59,480
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
getCollectionCount
function getCollectionCount() external view returns (uint256);
/// @notice Returns number of collections
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 5739, 5803 ] }
59,481
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
tokenURI
function tokenURI(uint256 tokenId) external view returns (string memory);
/// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 5935, 6010 ] }
59,482
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
getFeeRecipients
function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory);
/// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 6137, 6231 ] }
59,483
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
getFeeBps
function getFeeBps(uint256 tokenId) external view returns (uint256[] memory);
/// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 6367, 6446 ] }
59,484
Packs
contracts/IPacks.sol
0x1495ecbac40a69028b5d516597137de5e929b01b
Solidity
IPacks
interface IPacks is IERC721Enumerable { /* * cID refers to collection ID * Should not have more than 1000 editions of the same collectible (gas limit recommended, technically can support ~4000 editions) */ /// @notice Transfers contract ownership to DAO / different address /// @param _daoAddress The new address function transferDAOownership(address payable _daoAddress) external; /// @notice Creates a new collection / drop (first collection is created via constructor) /// @param _baseURI Base URI (e.g. https://arweave.net/) /// @param _editioned Toggle to show edition # in returned metadata /// @param _initParams Initialization parameters in array [token price, bulk buy max quantity, start time of sale] /// @param _licenseURI Global license URI of collection / drop /// @param _mintPass ERC721 contract address to allow 1 free mint prior to sale start time /// @param _mintPassDuration Duration before sale start time allowing free mints /// @param _mintPassParams Array of params for mintPass [One Per Wallet, Mint Pass ONLY, Mint Pass Free Mint, Mint Pass Burn] function createNewCollection(string memory _baseURI, bool _editioned, uint256[] memory _initParams, string memory _licenseURI, address _mintPass, uint256 _mintPassDuration, bool[] memory _mintPassParams) external; /// @notice Adds a collectible with multiple versions of artwork, metadata, and royalty declaration /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value [key, value, 0 = uneditable || 1 = editable] /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function addCollectible(uint256 cID, string[] memory _coreData, string[] memory _assets, string[][] memory _metadataValues, string[][] memory _secondaryMetadata, LibPackStorage.Fee[] memory _fees) external; /// @notice Add multiple collectibles in one function call, same parameters as addCollectible but in array /// @param cID Collection ID /// @param _coreData Array of parameters [title, description, # of NFTs, current artwork version index starting 1] /// @param _assets Array of artwork assets, starting index 0 indicative of version 1 /// @param _metadataValues Array of key value pairs for property name and value /// @param _secondaryMetadata Array of key value pairs for property name and value /// @param _fees Array of different percentage payout splits on secondary sales function bulkAddCollectible(uint256 cID, string[][] memory _coreData, string[][] memory _assets, string[][][] memory _metadataValues, string[][][] memory _secondaryMetadata, LibPackStorage.Fee[][] memory _fees) external; /// @notice Checks if owner of an NFT in free mint required ERC721 collection address /// @param cID Collection ID /// @param minter Address of user // function checkMintPass(uint256 cID, address minter) external view returns (uint256); /// @notice Mints an NFT with random token ID /// @param cID Collection ID function mintPack(uint256 cID) external payable; /// @notice Mints multiple NFTs with random token IDs /// @param cID Collection ID /// @param amount # of NFTs to mint function bulkMintPack(uint256 cID, uint256 amount) external payable; /// @notice Returns if an NFT was used as mint pass claim /// @param cID Collection ID /// @param tokenId NFT tokenID function mintPassClaimed(uint256 cID, uint256 tokenId) external view returns (bool); /// @notice Returns enumerable list of tokens that can be used to claim for mint pass /// @param cID Collection ID /// @param minter address of holder function tokensClaimable(uint256 cID, address minter) external view returns (uint256[] memory); /// @notice Returns remaining NFTs available to purchase /// @param cID Collection ID function remainingTokens(uint256 cID) external view returns (uint256); /// @notice Updates metadata value given property is editable /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param propertyIndex Index of property to update (value 0 is index 0) /// @param value Value of property to update function updateMetadata(uint256 cID, uint256 collectibleId, uint256 propertyIndex, string memory value) external; /// @notice Adds new URI version with provided asset /// @param cID Collection ID /// @param collectibleId Collectible index (value 1 is index 0) /// @param asset Asset hash without baseURI included function addVersion(uint256 cID, uint256 collectibleId, string memory asset) external; // /// @notice Updates asset version of collectible // /// @param cID Collection ID // /// @param collectibleId Collectible index (value 1 is index 0) // /// @param versionNumber New version number to set collectible's asset to // function updateVersion(uint256 cID, uint256 collectibleId, uint256 versionNumber) external; /// @notice Adds new license URL for collection, auto increments license version number /// @param cID Collection ID /// @param _license Full URL of license function addNewLicense(uint256 cID, string memory _license) external; /// @notice Gets license given a license version /// @param cID Collection ID /// @param versionNumber Version number of license function getLicense(uint256 cID, uint256 versionNumber) external view returns (string memory); /// @notice Returns number of collections function getCollectionCount() external view returns (uint256); /// @notice Dynamically generates tokenURI as base64 encoded JSON of on-chain metadata /// @param tokenId NFT/Token ID number function tokenURI(uint256 tokenId) external view returns (string memory); /// @notice Returns addresses of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); /// @notice Returns basis point values of secondary sale fees (Rarible Royalties Standard) /// @param tokenId NFT/Token ID number function getFeeBps(uint256 tokenId) external view returns (uint256[] memory); /// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount); }
/// @title Creators can release NFTs with multiple collectibles, across multiple collections/drops, and buyers will receive a random tokenID /// @notice This interface should be implemented by the Packs contract /// @dev This interface should be implemented by the Packs contract
NatSpecSingleLine
royaltyInfo
function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address recipient, uint256 amount);
/// @notice Returns address and value of secondary sale fee (EIP-2981 royalties standard) /// @param tokenId NFT/Token ID number /// @param value ETH/ERC20 value to calculate from
NatSpecSingleLine
v0.7.3+commit.9bfce1f6
{ "func_code_index": [ 6634, 6747 ] }
59,485
RedditInu
RedditInu.sol
0xf1fbfdf5b13aa626f7c9cc496eacfe1c92b55c9e
Solidity
RedditInu
contract RedditInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Reddit Inu"; string private constant _symbol = "RINU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint8 private _buyTaxRate; uint8 private _sellTaxRate; uint8 private _txTaxRate; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 2; //Sell Fee uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 13; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x5220b63BaABc16C0626FBf6E72d3Cf5a8F0Eeb32); address payable private _marketingAddress = payable(0x5A3Ce6e19ddC309Bfab813d89fFB0276FBe3AE97); address payable private _charityAddress = payable(0xE123fA8F35b32439Fd788685324d377835D22dE5); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 3000000000000 * 10**9; //0.3 uint256 public _maxWalletSize = 10000000000000 * 10**9; //1 uint256 public _swapTokensAtAmount = 1000000000000 * 10**9; //0.1 event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_charityAddress] = true; preTrader[owner()] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner() && !preTrader[from] && !preTrader[to]) { //Trade start check if (!tradingOpen) { require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(5)); _marketingAddress.transfer(amount.div(2)); _charityAddress.transfer(amount.mul(3).div(10)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress || _msgSender() == _charityAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress || _msgSender() == _charityAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } function allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } function setTaxWallets(address newTaxWall1, address newTaxWall2, address newTaxWall3) public onlyOwner { _developmentAddress = payable(newTaxWall1); _marketingAddress = payable(newTaxWall2); _charityAddress = payable(newTaxWall3); _isExcludedFromFee[newTaxWall1] = true; _isExcludedFromFee[newTaxWall2] = true; _isExcludedFromFee[newTaxWall3] = true; } }
setMinSwapTokensThreshold
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; }
//Set minimum tokens required to swap.
LineComment
v0.8.11+commit.d7f03943
None
ipfs://09f4361e91067f23585e65b0686ef91b211e13cecdbecb1c8fd6ee9d3fd0f054
{ "func_code_index": [ 13546, 13690 ] }
59,486
RedditInu
RedditInu.sol
0xf1fbfdf5b13aa626f7c9cc496eacfe1c92b55c9e
Solidity
RedditInu
contract RedditInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Reddit Inu"; string private constant _symbol = "RINU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint8 private _buyTaxRate; uint8 private _sellTaxRate; uint8 private _txTaxRate; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 2; //Sell Fee uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 13; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x5220b63BaABc16C0626FBf6E72d3Cf5a8F0Eeb32); address payable private _marketingAddress = payable(0x5A3Ce6e19ddC309Bfab813d89fFB0276FBe3AE97); address payable private _charityAddress = payable(0xE123fA8F35b32439Fd788685324d377835D22dE5); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 3000000000000 * 10**9; //0.3 uint256 public _maxWalletSize = 10000000000000 * 10**9; //1 uint256 public _swapTokensAtAmount = 1000000000000 * 10**9; //0.1 event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_charityAddress] = true; preTrader[owner()] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner() && !preTrader[from] && !preTrader[to]) { //Trade start check if (!tradingOpen) { require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(5)); _marketingAddress.transfer(amount.div(2)); _charityAddress.transfer(amount.mul(3).div(10)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress || _msgSender() == _charityAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress || _msgSender() == _charityAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } function allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } function setTaxWallets(address newTaxWall1, address newTaxWall2, address newTaxWall3) public onlyOwner { _developmentAddress = payable(newTaxWall1); _marketingAddress = payable(newTaxWall2); _charityAddress = payable(newTaxWall3); _isExcludedFromFee[newTaxWall1] = true; _isExcludedFromFee[newTaxWall2] = true; _isExcludedFromFee[newTaxWall3] = true; } }
toggleSwap
function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; }
//Set minimum tokens required to swap.
LineComment
v0.8.11+commit.d7f03943
None
ipfs://09f4361e91067f23585e65b0686ef91b211e13cecdbecb1c8fd6ee9d3fd0f054
{ "func_code_index": [ 13741, 13847 ] }
59,487
RedditInu
RedditInu.sol
0xf1fbfdf5b13aa626f7c9cc496eacfe1c92b55c9e
Solidity
RedditInu
contract RedditInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Reddit Inu"; string private constant _symbol = "RINU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint8 private _buyTaxRate; uint8 private _sellTaxRate; uint8 private _txTaxRate; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 2; //Sell Fee uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 13; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x5220b63BaABc16C0626FBf6E72d3Cf5a8F0Eeb32); address payable private _marketingAddress = payable(0x5A3Ce6e19ddC309Bfab813d89fFB0276FBe3AE97); address payable private _charityAddress = payable(0xE123fA8F35b32439Fd788685324d377835D22dE5); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 3000000000000 * 10**9; //0.3 uint256 public _maxWalletSize = 10000000000000 * 10**9; //1 uint256 public _swapTokensAtAmount = 1000000000000 * 10**9; //0.1 event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_charityAddress] = true; preTrader[owner()] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner() && !preTrader[from] && !preTrader[to]) { //Trade start check if (!tradingOpen) { require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(5)); _marketingAddress.transfer(amount.div(2)); _charityAddress.transfer(amount.mul(3).div(10)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress || _msgSender() == _charityAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress || _msgSender() == _charityAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } function allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } function setTaxWallets(address newTaxWall1, address newTaxWall2, address newTaxWall3) public onlyOwner { _developmentAddress = payable(newTaxWall1); _marketingAddress = payable(newTaxWall2); _charityAddress = payable(newTaxWall3); _isExcludedFromFee[newTaxWall1] = true; _isExcludedFromFee[newTaxWall2] = true; _isExcludedFromFee[newTaxWall3] = true; } }
setMaxTxnAmount
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; }
//Set MAx transaction
LineComment
v0.8.11+commit.d7f03943
None
ipfs://09f4361e91067f23585e65b0686ef91b211e13cecdbecb1c8fd6ee9d3fd0f054
{ "func_code_index": [ 13881, 13994 ] }
59,488
ZenswapLiquidityToken
ZenswapLiquidityToken.sol
0xf5d00367e6e0f2d3ac29997641b81c153a8f6444
Solidity
ZenswapLiquidityToken
contract ZenswapLiquidityToken is Ownable { // Public variables of the token string public name = "Zenswap Liquidity Token"; string public symbol = "ZLT-U"; uint8 public decimals = 18; uint256 public initialSupply = 120000000000000000000000000; uint256 public totalSupply; bool public canSwap = false; address public swapAddress; swappingContract public swapContract; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor() public { totalSupply = initialSupply; // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens } // This sets the swap contract address for swapping this token to the official ZLT token function setSwapContract(address _swapAddress) public onlyOwner { swapContract = swappingContract(_swapAddress); swapAddress = _swapAddress; canSwap = true; } function toggleSwap() public onlyOwner { if(canSwap) { canSwap = false; } else { canSwap = true; } } // Calls the external swap contract and trigger the swap of ZLT-U to official ZLT token function swapThisToken(address _from, uint256 _value) internal returns(bool success) { bool isSuccessful; // Note: Set the external contract to return bool in this function isSuccessful = swapContract.swapAssets(_from, _value); return isSuccessful; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal { bool swapSuccess = true; // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Additional function for official ZLT token swap if(canSwap && _to == swapAddress) { swapSuccess = false; swapSuccess = swapThisToken(_from, _value); } // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances && swapSuccess); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } }
/** * This ZLT-U token will be swapped to official ZLT token before Zenswap platform launch */
NatSpecMultiLine
setSwapContract
function setSwapContract(address _swapAddress) public onlyOwner { swapContract = swappingContract(_swapAddress); swapAddress = _swapAddress; canSwap = true; }
// This sets the swap contract address for swapping this token to the official ZLT token
LineComment
v0.4.24+commit.e67f0147
bzzr://05e623100cb0b0b74cfc1ec8017ab306857b4be3378a895c6bd97fe272c96454
{ "func_code_index": [ 1332, 1527 ] }
59,489
ZenswapLiquidityToken
ZenswapLiquidityToken.sol
0xf5d00367e6e0f2d3ac29997641b81c153a8f6444
Solidity
ZenswapLiquidityToken
contract ZenswapLiquidityToken is Ownable { // Public variables of the token string public name = "Zenswap Liquidity Token"; string public symbol = "ZLT-U"; uint8 public decimals = 18; uint256 public initialSupply = 120000000000000000000000000; uint256 public totalSupply; bool public canSwap = false; address public swapAddress; swappingContract public swapContract; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor() public { totalSupply = initialSupply; // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens } // This sets the swap contract address for swapping this token to the official ZLT token function setSwapContract(address _swapAddress) public onlyOwner { swapContract = swappingContract(_swapAddress); swapAddress = _swapAddress; canSwap = true; } function toggleSwap() public onlyOwner { if(canSwap) { canSwap = false; } else { canSwap = true; } } // Calls the external swap contract and trigger the swap of ZLT-U to official ZLT token function swapThisToken(address _from, uint256 _value) internal returns(bool success) { bool isSuccessful; // Note: Set the external contract to return bool in this function isSuccessful = swapContract.swapAssets(_from, _value); return isSuccessful; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal { bool swapSuccess = true; // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Additional function for official ZLT token swap if(canSwap && _to == swapAddress) { swapSuccess = false; swapSuccess = swapThisToken(_from, _value); } // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances && swapSuccess); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } }
/** * This ZLT-U token will be swapped to official ZLT token before Zenswap platform launch */
NatSpecMultiLine
swapThisToken
function swapThisToken(address _from, uint256 _value) internal returns(bool success) { bool isSuccessful; // Note: Set the external contract to return bool in this function isSuccessful = swapContract.swapAssets(_from, _value); return isSuccessful; }
// Calls the external swap contract and trigger the swap of ZLT-U to official ZLT token
LineComment
v0.4.24+commit.e67f0147
bzzr://05e623100cb0b0b74cfc1ec8017ab306857b4be3378a895c6bd97fe272c96454
{ "func_code_index": [ 1789, 2085 ] }
59,490
ZenswapLiquidityToken
ZenswapLiquidityToken.sol
0xf5d00367e6e0f2d3ac29997641b81c153a8f6444
Solidity
ZenswapLiquidityToken
contract ZenswapLiquidityToken is Ownable { // Public variables of the token string public name = "Zenswap Liquidity Token"; string public symbol = "ZLT-U"; uint8 public decimals = 18; uint256 public initialSupply = 120000000000000000000000000; uint256 public totalSupply; bool public canSwap = false; address public swapAddress; swappingContract public swapContract; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor() public { totalSupply = initialSupply; // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens } // This sets the swap contract address for swapping this token to the official ZLT token function setSwapContract(address _swapAddress) public onlyOwner { swapContract = swappingContract(_swapAddress); swapAddress = _swapAddress; canSwap = true; } function toggleSwap() public onlyOwner { if(canSwap) { canSwap = false; } else { canSwap = true; } } // Calls the external swap contract and trigger the swap of ZLT-U to official ZLT token function swapThisToken(address _from, uint256 _value) internal returns(bool success) { bool isSuccessful; // Note: Set the external contract to return bool in this function isSuccessful = swapContract.swapAssets(_from, _value); return isSuccessful; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal { bool swapSuccess = true; // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Additional function for official ZLT token swap if(canSwap && _to == swapAddress) { swapSuccess = false; swapSuccess = swapThisToken(_from, _value); } // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances && swapSuccess); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } }
/** * This ZLT-U token will be swapped to official ZLT token before Zenswap platform launch */
NatSpecMultiLine
_transfer
function _transfer(address _from, address _to, uint256 _value) internal { bool swapSuccess = true; // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Additional function for official ZLT token swap if(canSwap && _to == swapAddress) { swapSuccess = false; swapSuccess = swapThisToken(_from, _value); } // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances && swapSuccess); }
/** * Internal transfer, only can be called by this contract */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://05e623100cb0b0b74cfc1ec8017ab306857b4be3378a895c6bd97fe272c96454
{ "func_code_index": [ 2171, 3297 ] }
59,491
ZenswapLiquidityToken
ZenswapLiquidityToken.sol
0xf5d00367e6e0f2d3ac29997641b81c153a8f6444
Solidity
ZenswapLiquidityToken
contract ZenswapLiquidityToken is Ownable { // Public variables of the token string public name = "Zenswap Liquidity Token"; string public symbol = "ZLT-U"; uint8 public decimals = 18; uint256 public initialSupply = 120000000000000000000000000; uint256 public totalSupply; bool public canSwap = false; address public swapAddress; swappingContract public swapContract; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor() public { totalSupply = initialSupply; // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens } // This sets the swap contract address for swapping this token to the official ZLT token function setSwapContract(address _swapAddress) public onlyOwner { swapContract = swappingContract(_swapAddress); swapAddress = _swapAddress; canSwap = true; } function toggleSwap() public onlyOwner { if(canSwap) { canSwap = false; } else { canSwap = true; } } // Calls the external swap contract and trigger the swap of ZLT-U to official ZLT token function swapThisToken(address _from, uint256 _value) internal returns(bool success) { bool isSuccessful; // Note: Set the external contract to return bool in this function isSuccessful = swapContract.swapAssets(_from, _value); return isSuccessful; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal { bool swapSuccess = true; // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Additional function for official ZLT token swap if(canSwap && _to == swapAddress) { swapSuccess = false; swapSuccess = swapThisToken(_from, _value); } // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances && swapSuccess); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } }
/** * This ZLT-U token will be swapped to official ZLT token before Zenswap platform launch */
NatSpecMultiLine
transfer
function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); }
/** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://05e623100cb0b0b74cfc1ec8017ab306857b4be3378a895c6bd97fe272c96454
{ "func_code_index": [ 3503, 3625 ] }
59,492
ZenswapLiquidityToken
ZenswapLiquidityToken.sol
0xf5d00367e6e0f2d3ac29997641b81c153a8f6444
Solidity
ZenswapLiquidityToken
contract ZenswapLiquidityToken is Ownable { // Public variables of the token string public name = "Zenswap Liquidity Token"; string public symbol = "ZLT-U"; uint8 public decimals = 18; uint256 public initialSupply = 120000000000000000000000000; uint256 public totalSupply; bool public canSwap = false; address public swapAddress; swappingContract public swapContract; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor() public { totalSupply = initialSupply; // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens } // This sets the swap contract address for swapping this token to the official ZLT token function setSwapContract(address _swapAddress) public onlyOwner { swapContract = swappingContract(_swapAddress); swapAddress = _swapAddress; canSwap = true; } function toggleSwap() public onlyOwner { if(canSwap) { canSwap = false; } else { canSwap = true; } } // Calls the external swap contract and trigger the swap of ZLT-U to official ZLT token function swapThisToken(address _from, uint256 _value) internal returns(bool success) { bool isSuccessful; // Note: Set the external contract to return bool in this function isSuccessful = swapContract.swapAssets(_from, _value); return isSuccessful; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal { bool swapSuccess = true; // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Additional function for official ZLT token swap if(canSwap && _to == swapAddress) { swapSuccess = false; swapSuccess = swapThisToken(_from, _value); } // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances && swapSuccess); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } }
/** * This ZLT-U token will be swapped to official ZLT token before Zenswap platform launch */
NatSpecMultiLine
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; }
/** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://05e623100cb0b0b74cfc1ec8017ab306857b4be3378a895c6bd97fe272c96454
{ "func_code_index": [ 3900, 4201 ] }
59,493
ZenswapLiquidityToken
ZenswapLiquidityToken.sol
0xf5d00367e6e0f2d3ac29997641b81c153a8f6444
Solidity
ZenswapLiquidityToken
contract ZenswapLiquidityToken is Ownable { // Public variables of the token string public name = "Zenswap Liquidity Token"; string public symbol = "ZLT-U"; uint8 public decimals = 18; uint256 public initialSupply = 120000000000000000000000000; uint256 public totalSupply; bool public canSwap = false; address public swapAddress; swappingContract public swapContract; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor() public { totalSupply = initialSupply; // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens } // This sets the swap contract address for swapping this token to the official ZLT token function setSwapContract(address _swapAddress) public onlyOwner { swapContract = swappingContract(_swapAddress); swapAddress = _swapAddress; canSwap = true; } function toggleSwap() public onlyOwner { if(canSwap) { canSwap = false; } else { canSwap = true; } } // Calls the external swap contract and trigger the swap of ZLT-U to official ZLT token function swapThisToken(address _from, uint256 _value) internal returns(bool success) { bool isSuccessful; // Note: Set the external contract to return bool in this function isSuccessful = swapContract.swapAssets(_from, _value); return isSuccessful; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal { bool swapSuccess = true; // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Additional function for official ZLT token swap if(canSwap && _to == swapAddress) { swapSuccess = false; swapSuccess = swapThisToken(_from, _value); } // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances && swapSuccess); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } }
/** * This ZLT-U token will be swapped to official ZLT token before Zenswap platform launch */
NatSpecMultiLine
approve
function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; }
/** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://05e623100cb0b0b74cfc1ec8017ab306857b4be3378a895c6bd97fe272c96454
{ "func_code_index": [ 4465, 4641 ] }
59,494
ZenswapLiquidityToken
ZenswapLiquidityToken.sol
0xf5d00367e6e0f2d3ac29997641b81c153a8f6444
Solidity
ZenswapLiquidityToken
contract ZenswapLiquidityToken is Ownable { // Public variables of the token string public name = "Zenswap Liquidity Token"; string public symbol = "ZLT-U"; uint8 public decimals = 18; uint256 public initialSupply = 120000000000000000000000000; uint256 public totalSupply; bool public canSwap = false; address public swapAddress; swappingContract public swapContract; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor() public { totalSupply = initialSupply; // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens } // This sets the swap contract address for swapping this token to the official ZLT token function setSwapContract(address _swapAddress) public onlyOwner { swapContract = swappingContract(_swapAddress); swapAddress = _swapAddress; canSwap = true; } function toggleSwap() public onlyOwner { if(canSwap) { canSwap = false; } else { canSwap = true; } } // Calls the external swap contract and trigger the swap of ZLT-U to official ZLT token function swapThisToken(address _from, uint256 _value) internal returns(bool success) { bool isSuccessful; // Note: Set the external contract to return bool in this function isSuccessful = swapContract.swapAssets(_from, _value); return isSuccessful; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal { bool swapSuccess = true; // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Additional function for official ZLT token swap if(canSwap && _to == swapAddress) { swapSuccess = false; swapSuccess = swapThisToken(_from, _value); } // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances && swapSuccess); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } }
/** * This ZLT-U token will be swapped to official ZLT token before Zenswap platform launch */
NatSpecMultiLine
approveAndCall
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } }
/** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://05e623100cb0b0b74cfc1ec8017ab306857b4be3378a895c6bd97fe272c96454
{ "func_code_index": [ 5035, 5387 ] }
59,495
ZenswapLiquidityToken
ZenswapLiquidityToken.sol
0xf5d00367e6e0f2d3ac29997641b81c153a8f6444
Solidity
ZenswapLiquidityToken
contract ZenswapLiquidityToken is Ownable { // Public variables of the token string public name = "Zenswap Liquidity Token"; string public symbol = "ZLT-U"; uint8 public decimals = 18; uint256 public initialSupply = 120000000000000000000000000; uint256 public totalSupply; bool public canSwap = false; address public swapAddress; swappingContract public swapContract; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor() public { totalSupply = initialSupply; // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens } // This sets the swap contract address for swapping this token to the official ZLT token function setSwapContract(address _swapAddress) public onlyOwner { swapContract = swappingContract(_swapAddress); swapAddress = _swapAddress; canSwap = true; } function toggleSwap() public onlyOwner { if(canSwap) { canSwap = false; } else { canSwap = true; } } // Calls the external swap contract and trigger the swap of ZLT-U to official ZLT token function swapThisToken(address _from, uint256 _value) internal returns(bool success) { bool isSuccessful; // Note: Set the external contract to return bool in this function isSuccessful = swapContract.swapAssets(_from, _value); return isSuccessful; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal { bool swapSuccess = true; // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Additional function for official ZLT token swap if(canSwap && _to == swapAddress) { swapSuccess = false; swapSuccess = swapThisToken(_from, _value); } // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances && swapSuccess); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } }
/** * This ZLT-U token will be swapped to official ZLT token before Zenswap platform launch */
NatSpecMultiLine
burn
function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; }
/** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://05e623100cb0b0b74cfc1ec8017ab306857b4be3378a895c6bd97fe272c96454
{ "func_code_index": [ 5557, 5936 ] }
59,496
ZenswapLiquidityToken
ZenswapLiquidityToken.sol
0xf5d00367e6e0f2d3ac29997641b81c153a8f6444
Solidity
ZenswapLiquidityToken
contract ZenswapLiquidityToken is Ownable { // Public variables of the token string public name = "Zenswap Liquidity Token"; string public symbol = "ZLT-U"; uint8 public decimals = 18; uint256 public initialSupply = 120000000000000000000000000; uint256 public totalSupply; bool public canSwap = false; address public swapAddress; swappingContract public swapContract; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor() public { totalSupply = initialSupply; // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens } // This sets the swap contract address for swapping this token to the official ZLT token function setSwapContract(address _swapAddress) public onlyOwner { swapContract = swappingContract(_swapAddress); swapAddress = _swapAddress; canSwap = true; } function toggleSwap() public onlyOwner { if(canSwap) { canSwap = false; } else { canSwap = true; } } // Calls the external swap contract and trigger the swap of ZLT-U to official ZLT token function swapThisToken(address _from, uint256 _value) internal returns(bool success) { bool isSuccessful; // Note: Set the external contract to return bool in this function isSuccessful = swapContract.swapAssets(_from, _value); return isSuccessful; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal { bool swapSuccess = true; // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Additional function for official ZLT token swap if(canSwap && _to == swapAddress) { swapSuccess = false; swapSuccess = swapThisToken(_from, _value); } // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances && swapSuccess); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } }
/** * This ZLT-U token will be swapped to official ZLT token before Zenswap platform launch */
NatSpecMultiLine
burnFrom
function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; }
/** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://05e623100cb0b0b74cfc1ec8017ab306857b4be3378a895c6bd97fe272c96454
{ "func_code_index": [ 6194, 6810 ] }
59,497
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } }
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */
NatSpecMultiLine
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-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; }
/** * @dev Multiplies two unsigned integers, reverts on overflow. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 104, 542 ] }
59,498
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } }
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 670, 978 ] }
59,499
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } }
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; }
/** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 1109, 1264 ] }
59,500
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } }
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; }
/** * @dev Adds two unsigned integers, reverts on overflow. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 1345, 1500 ] }
59,501
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } }
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; }
/** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 1653, 1782 ] }
59,502
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping(address => uint256) private _deposits; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 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) { _transfer(msg.sender, 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) { //require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); 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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } function depositsOf(address _payee) public view returns (uint) { return _deposits[_payee]; } function lendingInvest(address to, uint256 value, uint plan) public returns (bool) { _lendingInvest(to, value, plan); return true; } function lendingWithdraw(uint256 value) public returns (bool) { _lendingWithdraw(value); return true; } function _lendingInvest(address to, uint256 value, uint plan) internal { require(value < balanceOf(msg.sender), "Not enough balance."); _transfer(msg.sender, to, value); _deposits[msg.sender] = _deposits[msg.sender].add(value); emit LendingInvest(msg.sender, to, value, plan, block.timestamp); } function _lendingWithdraw(uint256 value) internal { emit LendingWithdraw(msg.sender, value, block.timestamp); } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */
NatSpecMultiLine
totalSupply
function totalSupply() public view returns (uint256) { return _totalSupply; }
/** * @dev Total number of tokens in existence */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 349, 445 ] }
59,503
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping(address => uint256) private _deposits; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 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) { _transfer(msg.sender, 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) { //require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); 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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } function depositsOf(address _payee) public view returns (uint) { return _deposits[_payee]; } function lendingInvest(address to, uint256 value, uint plan) public returns (bool) { _lendingInvest(to, value, plan); return true; } function lendingWithdraw(uint256 value) public returns (bool) { _lendingWithdraw(value); return true; } function _lendingInvest(address to, uint256 value, uint plan) internal { require(value < balanceOf(msg.sender), "Not enough balance."); _transfer(msg.sender, to, value); _deposits[msg.sender] = _deposits[msg.sender].add(value); emit LendingInvest(msg.sender, to, value, plan, block.timestamp); } function _lendingWithdraw(uint256 value) internal { emit LendingWithdraw(msg.sender, value, block.timestamp); } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */
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 balance of. * @return An uint256 representing the amount owned by the passed address. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 656, 767 ] }
59,504
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping(address => uint256) private _deposits; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 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) { _transfer(msg.sender, 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) { //require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); 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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } function depositsOf(address _payee) public view returns (uint) { return _deposits[_payee]; } function lendingInvest(address to, uint256 value, uint plan) public returns (bool) { _lendingInvest(to, value, plan); return true; } function lendingWithdraw(uint256 value) public returns (bool) { _lendingWithdraw(value); return true; } function _lendingInvest(address to, uint256 value, uint plan) internal { require(value < balanceOf(msg.sender), "Not enough balance."); _transfer(msg.sender, to, value); _deposits[msg.sender] = _deposits[msg.sender].add(value); emit LendingInvest(msg.sender, to, value, plan, block.timestamp); } function _lendingWithdraw(uint256 value) internal { emit LendingWithdraw(msg.sender, value, block.timestamp); } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */
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.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 1101, 1237 ] }
59,505
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping(address => uint256) private _deposits; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 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) { _transfer(msg.sender, 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) { //require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); 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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } function depositsOf(address _payee) public view returns (uint) { return _deposits[_payee]; } function lendingInvest(address to, uint256 value, uint plan) public returns (bool) { _lendingInvest(to, value, plan); return true; } function lendingWithdraw(uint256 value) public returns (bool) { _lendingWithdraw(value); return true; } function _lendingInvest(address to, uint256 value, uint plan) internal { require(value < balanceOf(msg.sender), "Not enough balance."); _transfer(msg.sender, to, value); _deposits[msg.sender] = _deposits[msg.sender].add(value); emit LendingInvest(msg.sender, to, value, plan, block.timestamp); } function _lendingWithdraw(uint256 value) internal { emit LendingWithdraw(msg.sender, value, block.timestamp); } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */
NatSpecMultiLine
transfer
function transfer(address to, uint256 value) public returns (bool) { _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.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 1403, 1548 ] }
59,506
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping(address => uint256) private _deposits; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 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) { _transfer(msg.sender, 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) { //require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); 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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } function depositsOf(address _payee) public view returns (uint) { return _deposits[_payee]; } function lendingInvest(address to, uint256 value, uint plan) public returns (bool) { _lendingInvest(to, value, plan); return true; } function lendingWithdraw(uint256 value) public returns (bool) { _lendingWithdraw(value); return true; } function _lendingInvest(address to, uint256 value, uint plan) internal { require(value < balanceOf(msg.sender), "Not enough balance."); _transfer(msg.sender, to, value); _deposits[msg.sender] = _deposits[msg.sender].add(value); emit LendingInvest(msg.sender, to, value, plan, block.timestamp); } function _lendingWithdraw(uint256 value) internal { emit LendingWithdraw(msg.sender, value, block.timestamp); } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */
NatSpecMultiLine
approve
function approve(address spender, uint256 value) public returns (bool) { //require(spender != address(0)); _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.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 2190, 2441 ] }
59,507
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping(address => uint256) private _deposits; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 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) { _transfer(msg.sender, 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) { //require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); 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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } function depositsOf(address _payee) public view returns (uint) { return _deposits[_payee]; } function lendingInvest(address to, uint256 value, uint plan) public returns (bool) { _lendingInvest(to, value, plan); return true; } function lendingWithdraw(uint256 value) public returns (bool) { _lendingWithdraw(value); return true; } function _lendingInvest(address to, uint256 value, uint plan) internal { require(value < balanceOf(msg.sender), "Not enough balance."); _transfer(msg.sender, to, value); _deposits[msg.sender] = _deposits[msg.sender].add(value); emit LendingInvest(msg.sender, to, value, plan, block.timestamp); } function _lendingWithdraw(uint256 value) internal { emit LendingWithdraw(msg.sender, value, block.timestamp); } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */
NatSpecMultiLine
transferFrom
function transferFrom(address from, address to, uint256 value) public returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; }
/** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 2909, 3213 ] }
59,508
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping(address => uint256) private _deposits; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 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) { _transfer(msg.sender, 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) { //require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); 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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } function depositsOf(address _payee) public view returns (uint) { return _deposits[_payee]; } function lendingInvest(address to, uint256 value, uint plan) public returns (bool) { _lendingInvest(to, value, plan); return true; } function lendingWithdraw(uint256 value) public returns (bool) { _lendingWithdraw(value); return true; } function _lendingInvest(address to, uint256 value, uint plan) internal { require(value < balanceOf(msg.sender), "Not enough balance."); _transfer(msg.sender, to, value); _deposits[msg.sender] = _deposits[msg.sender].add(value); emit LendingInvest(msg.sender, to, value, plan, block.timestamp); } function _lendingWithdraw(uint256 value) internal { emit LendingWithdraw(msg.sender, value, block.timestamp); } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 3723, 4051 ] }
59,509
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping(address => uint256) private _deposits; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 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) { _transfer(msg.sender, 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) { //require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); 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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } function depositsOf(address _payee) public view returns (uint) { return _deposits[_payee]; } function lendingInvest(address to, uint256 value, uint plan) public returns (bool) { _lendingInvest(to, value, plan); return true; } function lendingWithdraw(uint256 value) public returns (bool) { _lendingWithdraw(value); return true; } function _lendingInvest(address to, uint256 value, uint plan) internal { require(value < balanceOf(msg.sender), "Not enough balance."); _transfer(msg.sender, to, value); _deposits[msg.sender] = _deposits[msg.sender].add(value); emit LendingInvest(msg.sender, to, value, plan, block.timestamp); } function _lendingWithdraw(uint256 value) internal { emit LendingWithdraw(msg.sender, value, block.timestamp); } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 4566, 4904 ] }
59,510
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping(address => uint256) private _deposits; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 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) { _transfer(msg.sender, 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) { //require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); 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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } function depositsOf(address _payee) public view returns (uint) { return _deposits[_payee]; } function lendingInvest(address to, uint256 value, uint plan) public returns (bool) { _lendingInvest(to, value, plan); return true; } function lendingWithdraw(uint256 value) public returns (bool) { _lendingWithdraw(value); return true; } function _lendingInvest(address to, uint256 value, uint plan) internal { require(value < balanceOf(msg.sender), "Not enough balance."); _transfer(msg.sender, to, value); _deposits[msg.sender] = _deposits[msg.sender].add(value); emit LendingInvest(msg.sender, to, value, plan, block.timestamp); } function _lendingWithdraw(uint256 value) internal { emit LendingWithdraw(msg.sender, value, block.timestamp); } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */
NatSpecMultiLine
_transfer
function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); }
/** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 5121, 5388 ] }
59,511
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping(address => uint256) private _deposits; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 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) { _transfer(msg.sender, 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) { //require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); 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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } function depositsOf(address _payee) public view returns (uint) { return _deposits[_payee]; } function lendingInvest(address to, uint256 value, uint plan) public returns (bool) { _lendingInvest(to, value, plan); return true; } function lendingWithdraw(uint256 value) public returns (bool) { _lendingWithdraw(value); return true; } function _lendingInvest(address to, uint256 value, uint plan) internal { require(value < balanceOf(msg.sender), "Not enough balance."); _transfer(msg.sender, to, value); _deposits[msg.sender] = _deposits[msg.sender].add(value); emit LendingInvest(msg.sender, to, value, plan, block.timestamp); } function _lendingWithdraw(uint256 value) internal { emit LendingWithdraw(msg.sender, value, block.timestamp); } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */
NatSpecMultiLine
_mint
function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); }
/** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 5735, 6009 ] }
59,512
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping(address => uint256) private _deposits; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 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) { _transfer(msg.sender, 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) { //require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); 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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } function depositsOf(address _payee) public view returns (uint) { return _deposits[_payee]; } function lendingInvest(address to, uint256 value, uint plan) public returns (bool) { _lendingInvest(to, value, plan); return true; } function lendingWithdraw(uint256 value) public returns (bool) { _lendingWithdraw(value); return true; } function _lendingInvest(address to, uint256 value, uint plan) internal { require(value < balanceOf(msg.sender), "Not enough balance."); _transfer(msg.sender, to, value); _deposits[msg.sender] = _deposits[msg.sender].add(value); emit LendingInvest(msg.sender, to, value, plan, block.timestamp); } function _lendingWithdraw(uint256 value) internal { emit LendingWithdraw(msg.sender, value, block.timestamp); } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */
NatSpecMultiLine
_burn
function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); }
/** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 6238, 6512 ] }
59,513
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping(address => uint256) private _deposits; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 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) { _transfer(msg.sender, 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) { //require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); 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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } function depositsOf(address _payee) public view returns (uint) { return _deposits[_payee]; } function lendingInvest(address to, uint256 value, uint plan) public returns (bool) { _lendingInvest(to, value, plan); return true; } function lendingWithdraw(uint256 value) public returns (bool) { _lendingWithdraw(value); return true; } function _lendingInvest(address to, uint256 value, uint plan) internal { require(value < balanceOf(msg.sender), "Not enough balance."); _transfer(msg.sender, to, value); _deposits[msg.sender] = _deposits[msg.sender].add(value); emit LendingInvest(msg.sender, to, value, plan, block.timestamp); } function _lendingWithdraw(uint256 value) internal { emit LendingWithdraw(msg.sender, value, block.timestamp); } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */
NatSpecMultiLine
_burnFrom
function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); }
/** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 6906, 7170 ] }
59,514
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20Detailed
contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { return _decimals; } }
/** * @title ERC20Detailed token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */
NatSpecMultiLine
name
function name() public view returns (string memory) { return _name; }
/** * @return the name of the token. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 356, 444 ] }
59,515
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20Detailed
contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { return _decimals; } }
/** * @title ERC20Detailed token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */
NatSpecMultiLine
symbol
function symbol() public view returns (string memory) { return _symbol; }
/** * @return the symbol of the token. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 506, 598 ] }
59,516
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
ERC20Detailed
contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { return _decimals; } }
/** * @title ERC20Detailed token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */
NatSpecMultiLine
decimals
function decimals() public view returns (uint8) { return _decimals; }
/** * @return the number of decimals of the token. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 672, 760 ] }
59,517
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
Ownable
contract Ownable { address private _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 () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @return the address of the owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner()); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { return 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 OwnershipTransferred(_owner, address(0)); _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
owner
function owner() public view returns (address) { return _owner; }
/** * @return the address of the owner. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 457, 541 ] }
59,518
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
Ownable
contract Ownable { address private _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 () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @return the address of the owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner()); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { return 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 OwnershipTransferred(_owner, address(0)); _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
isOwner
function isOwner() public view returns (bool) { return msg.sender == _owner; }
/** * @return true if `msg.sender` is the owner of the contract. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 792, 889 ] }
59,519
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
Ownable
contract Ownable { address private _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 () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @return the address of the owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner()); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { return 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 OwnershipTransferred(_owner, address(0)); _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 OwnershipTransferred(_owner, address(0)); _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.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 1170, 1315 ] }
59,520
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
Ownable
contract Ownable { address private _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 () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @return the address of the owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner()); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { return 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 OwnershipTransferred(_owner, address(0)); _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.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 1487, 1601 ] }
59,521
NephilimToken
NephilimToken.sol
0xc05a5115a7e40c3af2fed11e847d3a74a7c21c08
Solidity
Ownable
contract Ownable { address private _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 () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @return the address of the owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner()); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { return 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 OwnershipTransferred(_owner, address(0)); _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.5.16+commit.9c3226ce
None
bzzr://5838b2662d1912e6e51799f4139153ec7c0fd6d2ea662206d09588eb7f466c88
{ "func_code_index": [ 1746, 1938 ] }
59,522
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
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; } }
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */
NatSpecMultiLine
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.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 259, 445 ] }
59,523
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
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; } }
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */
NatSpecMultiLine
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.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 723, 864 ] }
59,524
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
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; } }
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */
NatSpecMultiLine
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.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 1162, 1359 ] }
59,525
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
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; } }
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */
NatSpecMultiLine
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.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 1613, 2089 ] }
59,526
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
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; } }
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */
NatSpecMultiLine
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.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 2560, 2697 ] }
59,527
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
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; } }
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */
NatSpecMultiLine
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.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 3188, 3471 ] }
59,528
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
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; } }
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */
NatSpecMultiLine
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.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 3931, 4066 ] }
59,529
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
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; } }
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */
NatSpecMultiLine
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.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 4546, 4717 ] }
59,530
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
Solidity
UniswapV2Library
library UniswapV2Library { using SafeMath for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash )))); } // fetches and sorts the reserves for a pair function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } // given an output amount of an asset and pair reserves, returns a required input amount of the other asset function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } }
sortTokens
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); }
// returns sorted token addresses, used to handle return values from pairs sorted in this order
LineComment
v0.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 161, 515 ] }
59,531
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
Solidity
UniswapV2Library
library UniswapV2Library { using SafeMath for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash )))); } // fetches and sorts the reserves for a pair function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } // given an output amount of an asset and pair reserves, returns a required input amount of the other asset function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } }
pairFor
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash )))); }
// calculates the CREATE2 address for a pair without making any external calls
LineComment
v0.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 602, 1085 ] }
59,532
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
Solidity
UniswapV2Library
library UniswapV2Library { using SafeMath for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash )))); } // fetches and sorts the reserves for a pair function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } // given an output amount of an asset and pair reserves, returns a required input amount of the other asset function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } }
getReserves
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); }
// fetches and sorts the reserves for a pair
LineComment
v0.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 1138, 1534 ] }
59,533
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
Solidity
UniswapV2Library
library UniswapV2Library { using SafeMath for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash )))); } // fetches and sorts the reserves for a pair function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } // given an output amount of an asset and pair reserves, returns a required input amount of the other asset function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } }
quote
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; }
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
LineComment
v0.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 1642, 1968 ] }
59,534
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
Solidity
UniswapV2Library
library UniswapV2Library { using SafeMath for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash )))); } // fetches and sorts the reserves for a pair function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } // given an output amount of an asset and pair reserves, returns a required input amount of the other asset function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } }
getAmountOut
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; }
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
LineComment
v0.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 2085, 2607 ] }
59,535
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
Solidity
UniswapV2Library
library UniswapV2Library { using SafeMath for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash )))); } // fetches and sorts the reserves for a pair function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } // given an output amount of an asset and pair reserves, returns a required input amount of the other asset function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } }
getAmountIn
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); }
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
LineComment
v0.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 2723, 3200 ] }
59,536
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
Solidity
UniswapV2Library
library UniswapV2Library { using SafeMath for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash )))); } // fetches and sorts the reserves for a pair function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } // given an output amount of an asset and pair reserves, returns a required input amount of the other asset function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } }
getAmountsOut
function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } }
// performs chained getAmountOut calculations on any number of pairs
LineComment
v0.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 3277, 3793 ] }
59,537
DSDRouterV1
DSDRouterV1.sol
0xd2150f143939d233924e48b8c9516d9fd7841d27
Solidity
UniswapV2Library
library UniswapV2Library { using SafeMath for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash )))); } // fetches and sorts the reserves for a pair function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } // given an output amount of an asset and pair reserves, returns a required input amount of the other asset function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } }
getAmountsIn
function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } }
// performs chained getAmountIn calculations on any number of pairs
LineComment
v0.7.6+commit.7338295f
None
ipfs://3b908ced1da876930f2e9db473d5baf57d758391eb0860135a5ef083c92f0e26
{ "func_code_index": [ 3869, 4406 ] }
59,538
UniswapV3Pool
contracts/libraries/Position.sol
0x5d752f322befb038991579972e912b02f61a3dda
Solidity
Position
library Position { // info stored for each user's position struct Info { // the amount of liquidity owned by this position uint128 liquidity; // fee growth per unit of liquidity as of the last update to liquidity or fees owed uint256 feeGrowthInside0LastX128; uint256 feeGrowthInside1LastX128; // the fees owed to the position owner in token0/token1 uint128 tokensOwed0; uint128 tokensOwed1; } /// @notice Returns the Info struct of a position, given an owner and position boundaries /// @param self The mapping containing all user positions /// @param owner The address of the position owner /// @param tickLower The lower tick boundary of the position /// @param tickUpper The upper tick boundary of the position /// @return position The position info struct of the given owners' position function get( mapping(bytes32 => Info) storage self, address owner, int24 tickLower, int24 tickUpper ) internal view returns (Position.Info storage position) { position = self[keccak256(abi.encodePacked(owner, tickLower, tickUpper))]; } /// @notice Credits accumulated fees to a user's position /// @param self The individual position to update /// @param liquidityDelta The change in pool liquidity as a result of the position update /// @param feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries /// @param feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries function update( Info storage self, int128 liquidityDelta, uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128 ) internal { Info memory _self = self; uint128 liquidityNext; if (liquidityDelta == 0) { require(_self.liquidity > 0, 'NP'); // disallow pokes for 0 liquidity positions liquidityNext = _self.liquidity; } else { liquidityNext = LiquidityMath.addDelta(_self.liquidity, liquidityDelta); } // calculate accumulated fees uint128 tokensOwed0 = uint128( FullMath.mulDiv( feeGrowthInside0X128 - _self.feeGrowthInside0LastX128, _self.liquidity, FixedPoint128.Q128 ) ); uint128 tokensOwed1 = uint128( FullMath.mulDiv( feeGrowthInside1X128 - _self.feeGrowthInside1LastX128, _self.liquidity, FixedPoint128.Q128 ) ); // update the position if (liquidityDelta != 0) self.liquidity = liquidityNext; self.feeGrowthInside0LastX128 = feeGrowthInside0X128; self.feeGrowthInside1LastX128 = feeGrowthInside1X128; if (tokensOwed0 > 0 || tokensOwed1 > 0) { // overflow is acceptable, have to withdraw before you hit type(uint128).max fees self.tokensOwed0 += tokensOwed0; self.tokensOwed1 += tokensOwed1; } } }
/// @title Position /// @notice Positions represent an owner address' liquidity between a lower and upper tick boundary /// @dev Positions store additional state for tracking fees owed to the position
NatSpecSingleLine
get
function get( mapping(bytes32 => Info) storage self, address owner, int24 tickLower, int24 tickUpper ) internal view returns (Position.Info storage position) { position = self[keccak256(abi.encodePacked(owner, tickLower, tickUpper))]; }
/// @notice Returns the Info struct of a position, given an owner and position boundaries /// @param self The mapping containing all user positions /// @param owner The address of the position owner /// @param tickLower The lower tick boundary of the position /// @param tickUpper The upper tick boundary of the position /// @return position The position info struct of the given owners' position
NatSpecSingleLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 892, 1180 ] }
59,539
UniswapV3Pool
contracts/libraries/Position.sol
0x5d752f322befb038991579972e912b02f61a3dda
Solidity
Position
library Position { // info stored for each user's position struct Info { // the amount of liquidity owned by this position uint128 liquidity; // fee growth per unit of liquidity as of the last update to liquidity or fees owed uint256 feeGrowthInside0LastX128; uint256 feeGrowthInside1LastX128; // the fees owed to the position owner in token0/token1 uint128 tokensOwed0; uint128 tokensOwed1; } /// @notice Returns the Info struct of a position, given an owner and position boundaries /// @param self The mapping containing all user positions /// @param owner The address of the position owner /// @param tickLower The lower tick boundary of the position /// @param tickUpper The upper tick boundary of the position /// @return position The position info struct of the given owners' position function get( mapping(bytes32 => Info) storage self, address owner, int24 tickLower, int24 tickUpper ) internal view returns (Position.Info storage position) { position = self[keccak256(abi.encodePacked(owner, tickLower, tickUpper))]; } /// @notice Credits accumulated fees to a user's position /// @param self The individual position to update /// @param liquidityDelta The change in pool liquidity as a result of the position update /// @param feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries /// @param feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries function update( Info storage self, int128 liquidityDelta, uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128 ) internal { Info memory _self = self; uint128 liquidityNext; if (liquidityDelta == 0) { require(_self.liquidity > 0, 'NP'); // disallow pokes for 0 liquidity positions liquidityNext = _self.liquidity; } else { liquidityNext = LiquidityMath.addDelta(_self.liquidity, liquidityDelta); } // calculate accumulated fees uint128 tokensOwed0 = uint128( FullMath.mulDiv( feeGrowthInside0X128 - _self.feeGrowthInside0LastX128, _self.liquidity, FixedPoint128.Q128 ) ); uint128 tokensOwed1 = uint128( FullMath.mulDiv( feeGrowthInside1X128 - _self.feeGrowthInside1LastX128, _self.liquidity, FixedPoint128.Q128 ) ); // update the position if (liquidityDelta != 0) self.liquidity = liquidityNext; self.feeGrowthInside0LastX128 = feeGrowthInside0X128; self.feeGrowthInside1LastX128 = feeGrowthInside1X128; if (tokensOwed0 > 0 || tokensOwed1 > 0) { // overflow is acceptable, have to withdraw before you hit type(uint128).max fees self.tokensOwed0 += tokensOwed0; self.tokensOwed1 += tokensOwed1; } } }
/// @title Position /// @notice Positions represent an owner address' liquidity between a lower and upper tick boundary /// @dev Positions store additional state for tracking fees owed to the position
NatSpecSingleLine
update
function update( Info storage self, int128 liquidityDelta, uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128 ) internal { Info memory _self = self; uint128 liquidityNext; if (liquidityDelta == 0) { require(_self.liquidity > 0, 'NP'); // disallow pokes for 0 liquidity positions liquidityNext = _self.liquidity; } else { liquidityNext = LiquidityMath.addDelta(_self.liquidity, liquidityDelta); } // calculate accumulated fees uint128 tokensOwed0 = uint128( FullMath.mulDiv( feeGrowthInside0X128 - _self.feeGrowthInside0LastX128, _self.liquidity, FixedPoint128.Q128 ) ); uint128 tokensOwed1 = uint128( FullMath.mulDiv( feeGrowthInside1X128 - _self.feeGrowthInside1LastX128, _self.liquidity, FixedPoint128.Q128 ) ); // update the position if (liquidityDelta != 0) self.liquidity = liquidityNext; self.feeGrowthInside0LastX128 = feeGrowthInside0X128; self.feeGrowthInside1LastX128 = feeGrowthInside1X128; if (tokensOwed0 > 0 || tokensOwed1 > 0) { // overflow is acceptable, have to withdraw before you hit type(uint128).max fees self.tokensOwed0 += tokensOwed0; self.tokensOwed1 += tokensOwed1; } }
/// @notice Credits accumulated fees to a user's position /// @param self The individual position to update /// @param liquidityDelta The change in pool liquidity as a result of the position update /// @param feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries /// @param feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries
NatSpecSingleLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 1656, 3222 ] }
59,540
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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 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; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } }
/** * @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.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 633, 798 ] }
59,541
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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 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; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } }
/** * @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. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 880, 985 ] }
59,542
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 81, 228 ] }
59,543
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 304, 564 ] }
59,544
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 671, 775 ] }
59,545
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 831, 945 ] }
59,546
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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]; } }
totalSupply
function totalSupply() public view returns (uint256) { return totalSupply_; }
/** * @dev total number of tokens in existence */
NatSpecMultiLine
v0.4.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 181, 261 ] }
59,547
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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]; } }
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.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 407, 709 ] }
59,548
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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]; } }
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.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 903, 999 ] }
59,549
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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) { require((_value == 0 ) || (allowed[msg.sender][_spender] == 0)); 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; } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_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.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 376, 796 ] }
59,550
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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) { require((_value == 0 ) || (allowed[msg.sender][_spender] == 0)); 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; } }
/** * @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) { require((_value == 0 ) || (allowed[msg.sender][_spender] == 0)); 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.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 1401, 1646 ] }
59,551
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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) { require((_value == 0 ) || (allowed[msg.sender][_spender] == 0)); 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; } }
/** * @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.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 1952, 2075 ] }
59,552
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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) { require((_value == 0 ) || (allowed[msg.sender][_spender] == 0)); 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; } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
increaseApproval
function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); 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.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 2510, 2764 ] }
59,553
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
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) { require((_value == 0 ) || (allowed[msg.sender][_spender] == 0)); 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; } }
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
decreaseApproval
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } 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.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 3204, 3580 ] }
59,554
POT
POT.sol
0x6a01ee672da11086e8377d9e001efc7f61060703
Solidity
POT
contract POT is StandardToken{ string public constant name = "POT"; // solium-disable-line uppercase string public constant symbol = "POT"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 3000000000000000000000000000; uint256 public constant MAX_SUPPLY = 100 * 10000 * 10000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() POT() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } /** * The fallback function. */ function() payable public { revert(); } }
function() payable public { revert(); }
/** * The fallback function. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
None
bzzr://653cd540cc33493cd2b298b682a672508ef9408c5ad761b2f0a193064e73fafe
{ "func_code_index": [ 671, 713 ] }
59,555
BANANAS
BANANAS.sol
0x939566b6c1fcd3bb1e7740f6399491ce84bdca60
Solidity
BANANAS
contract BANANAS is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"CrazyBananas | t.me/CrazyBananas"; string private constant _symbol = unicode"BANANAS"; uint8 private constant _decimals = 9; uint256 private _taxFee = 6; uint256 private _teamFee = 4; uint256 private _feeRate = 5; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 40; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(6)).div(10); _teamFee = (_impactFee.mul(4)).div(10); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _taxFee = 6; _teamFee = 4; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (45 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 3000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (120 seconds); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } // fallback in case contract is not releasing tokens fast enough function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].buy; } function timeToSell(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].sell; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
setFeeRate
function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); }
// fallback in case contract is not releasing tokens fast enough
LineComment
v0.8.4+commit.c7e474f2
None
ipfs://f0faf4295a80b6dd1d2bfd44fcaf41a37667b31e460653fab39c56a5e0a3859f
{ "func_code_index": [ 12659, 12882 ] }
59,556
DexBrokerage
DexBrokerage.sol
0x41a5b8aa081dcd69ace566061d5b6adcb92cae1c
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // require(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // require(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @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) { require(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev a to power of b, throws on overflow. */ function pow(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a ** b; require(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) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; }
/** * @dev Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://08d43b7bceff4c3bda6099d6bfe95f6f51fadf64d77309ccc487dda94eb6b121
{ "func_code_index": [ 89, 273 ] }
59,557
DexBrokerage
DexBrokerage.sol
0x41a5b8aa081dcd69ace566061d5b6adcb92cae1c
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // require(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // require(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @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) { require(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev a to power of b, throws on overflow. */ function pow(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a ** b; require(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) { // require(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // require(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Integer division of two numbers, truncating the quotient. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://08d43b7bceff4c3bda6099d6bfe95f6f51fadf64d77309ccc487dda94eb6b121
{ "func_code_index": [ 357, 632 ] }
59,558
DexBrokerage
DexBrokerage.sol
0x41a5b8aa081dcd69ace566061d5b6adcb92cae1c
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // require(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // require(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @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) { require(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev a to power of b, throws on overflow. */ function pow(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a ** b; require(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) { require(b <= a); return a - b; }
/** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://08d43b7bceff4c3bda6099d6bfe95f6f51fadf64d77309ccc487dda94eb6b121
{ "func_code_index": [ 746, 863 ] }
59,559
DexBrokerage
DexBrokerage.sol
0x41a5b8aa081dcd69ace566061d5b6adcb92cae1c
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // require(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // require(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @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) { require(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev a to power of b, throws on overflow. */ function pow(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a ** b; require(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) { uint256 c = a + b; require(c >= a); return c; }
/** * @dev Adds two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://08d43b7bceff4c3bda6099d6bfe95f6f51fadf64d77309ccc487dda94eb6b121
{ "func_code_index": [ 927, 1064 ] }
59,560