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
MoonieNFT
contracts/ethereum/MoonieNFT.sol
0x744418761efbd3e7239d76e429d6df7f18fca590
Solidity
MoonieNFT
contract MoonieNFT is IERC721Mintable, ERC721Burnable, ERC721Enumerable, ERC721URIStorage, AccessControlMixin, NativeMetaTransaction, ContextMixin, FxBaseRootTunnel { // STATE CONSTANTS bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); // EVENT...
tokenURI
function tokenURI(uint256 tokenId) public view virtual override(ERC721, ERC721URIStorage) returns (string memory) { return super.tokenURI(tokenId); }
// VIEWS
LineComment
v0.8.4+commit.c7e474f2
MIT
ipfs://e272d0561e5d257fa285f8fe8be939eea21aea62940820517462c2d69edbff82
{ "func_code_index": [ 922, 1090 ] }
8,407
MoonieNFT
contracts/ethereum/MoonieNFT.sol
0x744418761efbd3e7239d76e429d6df7f18fca590
Solidity
MoonieNFT
contract MoonieNFT is IERC721Mintable, ERC721Burnable, ERC721Enumerable, ERC721URIStorage, AccessControlMixin, NativeMetaTransaction, ContextMixin, FxBaseRootTunnel { // STATE CONSTANTS bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); // EVENT...
mint
function mint(address user, uint256 tokenId, string memory tokenUri) external override only(MINTER_ROLE) { _mint(user, tokenId); _setTokenURI(tokenId, tokenUri); }
/** * @dev See {IMintableERC721-mint}. * * If you're attempting to bring metadata associated with token * from L2 to L1, you must implement this method */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
MIT
ipfs://e272d0561e5d257fa285f8fe8be939eea21aea62940820517462c2d69edbff82
{ "func_code_index": [ 1573, 1764 ] }
8,408
MoonieNFT
contracts/ethereum/MoonieNFT.sol
0x744418761efbd3e7239d76e429d6df7f18fca590
Solidity
MoonieNFT
contract MoonieNFT is IERC721Mintable, ERC721Burnable, ERC721Enumerable, ERC721URIStorage, AccessControlMixin, NativeMetaTransaction, ContextMixin, FxBaseRootTunnel { // STATE CONSTANTS bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); // EVENT...
_burn
function _burn(uint256 tokenId) internal virtual override(ERC721, ERC721URIStorage) { emit Burned(tokenId); super._burn(tokenId); }
// INTERNAL FUNCTIONS
LineComment
v0.8.4+commit.c7e474f2
MIT
ipfs://e272d0561e5d257fa285f8fe8be939eea21aea62940820517462c2d69edbff82
{ "func_code_index": [ 2264, 2423 ] }
8,409
MoonieNFT
contracts/ethereum/MoonieNFT.sol
0x744418761efbd3e7239d76e429d6df7f18fca590
Solidity
MoonieNFT
contract MoonieNFT is IERC721Mintable, ERC721Burnable, ERC721Enumerable, ERC721URIStorage, AccessControlMixin, NativeMetaTransaction, ContextMixin, FxBaseRootTunnel { // STATE CONSTANTS bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); // EVENT...
_msgSender
function _msgSender() internal override view returns (address) { return ContextMixin.msgSender(); }
// This is to support Native meta transactions // never use msg.sender directly, use _msgSender() instead
LineComment
v0.8.4+commit.c7e474f2
MIT
ipfs://e272d0561e5d257fa285f8fe8be939eea21aea62940820517462c2d69edbff82
{ "func_code_index": [ 2542, 2701 ] }
8,410
CyberFrogz
contracts/CyberFrogz.sol
0xdccc916bf4a0186065f4d1e5b94176f4d17b8c42
Solidity
CyberFrogz
contract CyberFrogz is ERC721, EIP712, Ownable { using Counters for Counters.Counter; using Strings for uint256; enum SaleStatus { PAUSED, PRESALE, PUBLIC } Counters.Counter private _tokenIds; uint public constant COLLECTION_SIZE = 5555; uint public constant MINT_PRICE = 0.1...
_baseURI
function _baseURI() internal view override returns (string memory) { return _baseUri; }
/// @dev override base uri. It will be combined with token ID
NatSpecSingleLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 1394, 1500 ] }
8,411
CyberFrogz
contracts/CyberFrogz.sol
0xdccc916bf4a0186065f4d1e5b94176f4d17b8c42
Solidity
CyberFrogz
contract CyberFrogz is ERC721, EIP712, Ownable { using Counters for Counters.Counter; using Strings for uint256; enum SaleStatus { PAUSED, PRESALE, PUBLIC } Counters.Counter private _tokenIds; uint public constant COLLECTION_SIZE = 5555; uint public constant MINT_PRICE = 0.1...
setHiddenUri
function setHiddenUri(string memory uri) external onlyOwner { _placeholderUri = uri; }
/// @notice Set hidden metadata uri
NatSpecSingleLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 1746, 1851 ] }
8,412
CyberFrogz
contracts/CyberFrogz.sol
0xdccc916bf4a0186065f4d1e5b94176f4d17b8c42
Solidity
CyberFrogz
contract CyberFrogz is ERC721, EIP712, Ownable { using Counters for Counters.Counter; using Strings for uint256; enum SaleStatus { PAUSED, PRESALE, PUBLIC } Counters.Counter private _tokenIds; uint public constant COLLECTION_SIZE = 5555; uint public constant MINT_PRICE = 0.1...
setSaleStatus
function setSaleStatus(SaleStatus status) external onlyOwner { saleStatus = status; }
/// @notice Set sales status
NatSpecSingleLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 1888, 1980 ] }
8,413
CyberFrogz
contracts/CyberFrogz.sol
0xdccc916bf4a0186065f4d1e5b94176f4d17b8c42
Solidity
CyberFrogz
contract CyberFrogz is ERC721, EIP712, Ownable { using Counters for Counters.Counter; using Strings for uint256; enum SaleStatus { PAUSED, PRESALE, PUBLIC } Counters.Counter private _tokenIds; uint public constant COLLECTION_SIZE = 5555; uint public constant MINT_PRICE = 0.1...
reveal
function reveal(string memory baseUri) external onlyOwner { require(!canReveal, "Already revealed"); _baseUri = baseUri; canReveal = true; }
/// @notice Reveal metadata for all the tokens
NatSpecSingleLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 2035, 2212 ] }
8,414
CyberFrogz
contracts/CyberFrogz.sol
0xdccc916bf4a0186065f4d1e5b94176f4d17b8c42
Solidity
CyberFrogz
contract CyberFrogz is ERC721, EIP712, Ownable { using Counters for Counters.Counter; using Strings for uint256; enum SaleStatus { PAUSED, PRESALE, PUBLIC } Counters.Counter private _tokenIds; uint public constant COLLECTION_SIZE = 5555; uint public constant MINT_PRICE = 0.1...
tokenURI
function tokenURI(uint256 tokenId) public view override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); return canReveal ? string(abi.encodePacked(_baseURI(), tokenId.toString(), ".json")) : _placeholderUri; }
/// @notice Get token's URI. In case of delayed reveal we give user the json of the placeholer metadata. /// @param tokenId token ID
NatSpecSingleLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 2358, 2680 ] }
8,415
CyberFrogz
contracts/CyberFrogz.sol
0xdccc916bf4a0186065f4d1e5b94176f4d17b8c42
Solidity
CyberFrogz
contract CyberFrogz is ERC721, EIP712, Ownable { using Counters for Counters.Counter; using Strings for uint256; enum SaleStatus { PAUSED, PRESALE, PUBLIC } Counters.Counter private _tokenIds; uint public constant COLLECTION_SIZE = 5555; uint public constant MINT_PRICE = 0.1...
withdraw
function withdraw() external onlyOwner { uint256 balance = address(this).balance; require(balance > 0, "No balance"); payable(owner()).transfer(balance); }
/// @notice Withdraw's contract's balance to the minter's address
NatSpecSingleLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 2754, 2948 ] }
8,416
CyberFrogz
contracts/CyberFrogz.sol
0xdccc916bf4a0186065f4d1e5b94176f4d17b8c42
Solidity
CyberFrogz
contract CyberFrogz is ERC721, EIP712, Ownable { using Counters for Counters.Counter; using Strings for uint256; enum SaleStatus { PAUSED, PRESALE, PUBLIC } Counters.Counter private _tokenIds; uint public constant COLLECTION_SIZE = 5555; uint public constant MINT_PRICE = 0.1...
redeem
function redeem(NFTVoucher calldata voucher, bytes memory signature) external payable { require(_verify(_hash(voucher), signature), "Transaction is not authorized (invalid signature)"); require(saleStatus != SaleStatus.PAUSED, "Sales are off"); require(_tokenIds.current() != COLLECTION_SIZE, "All token...
/// @notice Redeems an NFTVoucher for an actual NFT, creating it in the process. /// @param voucher An NFTVoucher that describes the NFT to be redeemed. /// @param signature An EIP712 signature of the voucher, produced by the NFT creator.
NatSpecSingleLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 3205, 4590 ] }
8,417
CyberFrogz
contracts/CyberFrogz.sol
0xdccc916bf4a0186065f4d1e5b94176f4d17b8c42
Solidity
CyberFrogz
contract CyberFrogz is ERC721, EIP712, Ownable { using Counters for Counters.Counter; using Strings for uint256; enum SaleStatus { PAUSED, PRESALE, PUBLIC } Counters.Counter private _tokenIds; uint public constant COLLECTION_SIZE = 5555; uint public constant MINT_PRICE = 0.1...
_mintTokens
function _mintTokens(address to, uint count) internal { for(uint index = 0; index < count; index++) { _tokenIds.increment(); uint newItemId = _tokenIds.current(); _safeMint(to, newItemId); } }
/// @dev perform actual minting of the tokens
NatSpecSingleLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 4644, 4907 ] }
8,418
CyberFrogz
contracts/CyberFrogz.sol
0xdccc916bf4a0186065f4d1e5b94176f4d17b8c42
Solidity
CyberFrogz
contract CyberFrogz is ERC721, EIP712, Ownable { using Counters for Counters.Counter; using Strings for uint256; enum SaleStatus { PAUSED, PRESALE, PUBLIC } Counters.Counter private _tokenIds; uint public constant COLLECTION_SIZE = 5555; uint public constant MINT_PRICE = 0.1...
_hash
function _hash(NFTVoucher calldata voucher) internal view returns (bytes32) { return _hashTypedDataV4(keccak256(abi.encode( keccak256("NFTVoucher(address redeemer,bool whitelisted,uint256 numberOfTokens)"), voucher.redeemer, voucher.whitelisted, voucher.numberOfTokens )))...
/// @notice Returns a hash of the given NFTVoucher, prepared using EIP712 typed data hashing rules. /// @param voucher An NFTVoucher to hash.
NatSpecSingleLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 5062, 5427 ] }
8,419
MainSale
MainSale.sol
0x2c8154b76f68f9b69de0d6d079c340e939451d8a
Solidity
MainSale
contract MainSale is Ownable { ERC20 public token; ERC20 public BuyBackContract; using SafeMath for uint; address public backEndOperator = msg.sender; address team = 0x550cBC2C3Ac03f8f1d950FEf755Cd664fc498036; // 10 % - founders address bounty = 0x8118317911B0De31502aC978e1dD38...
/** * @title MainCrowdSale * @dev https://github.com/elephant-marketing/*/
NatSpecMultiLine
authorize
function authorize(address wlCandidate, uint8 investorType) public backEnd { require(wlCandidate != address(0x0)); require(!isWhitelisted(wlCandidate)); require(investors == 1 || investorType == 2); whitelist[wlCandidate] = true; investors++; if (investorType == 1) { typeOfInvestors[...
/******************************************************************************* * Whitelist's section */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://7b7921e890523d45c3ead92a6484902f0fc5e9bb96cdb6b0fbc928eadef19245
{ "func_code_index": [ 2641, 3116 ] }
8,420
MainSale
MainSale.sol
0x2c8154b76f68f9b69de0d6d079c340e939451d8a
Solidity
MainSale
contract MainSale is Ownable { ERC20 public token; ERC20 public BuyBackContract; using SafeMath for uint; address public backEndOperator = msg.sender; address team = 0x550cBC2C3Ac03f8f1d950FEf755Cd664fc498036; // 10 % - founders address bounty = 0x8118317911B0De31502aC978e1dD38...
/** * @title MainCrowdSale * @dev https://github.com/elephant-marketing/*/
NatSpecMultiLine
isMainSale
function isMainSale() public constant returns(bool) { return now >= startMainSale && now <= endMainSale; }
/******************************************************************************* * Payable's section */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://7b7921e890523d45c3ead92a6484902f0fc5e9bb96cdb6b0fbc928eadef19245
{ "func_code_index": [ 3531, 3648 ] }
8,421
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
Ownable
contract Ownable { address public owner; /** * @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...
/** * @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 { if (newOwner != address(0)) { owner = newOwner; } }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 587, 743 ] }
8,422
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
Pausable
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function ...
/** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */
NatSpecMultiLine
pause
function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); }
/** * @dev called by the owner to pause, triggers stopped state */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 513, 609 ] }
8,423
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
Pausable
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function ...
/** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */
NatSpecMultiLine
unpause
function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); }
/** * @dev called by the owner to unpause, returns to normal state */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 693, 791 ] }
8,424
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
BasicToken
contract BasicToken is Ownable, ERC20Basic { using SafeMath for uint; mapping(address => uint) public balances; // additional variables for use if transaction fees ever became necessary uint public basisPointsRate = 0; uint public maximumFee = 0; /** * @dev Fix for the ERC20 sho...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
transfer
function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) { uint fee = (_value.mul(basisPointsRate)).div(10000); if (fee > maximumFee) { fee = maximumFee; } uint sendAmount = _value.sub(fee); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] =...
/** * @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
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 626, 1214 ] }
8,425
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
BasicToken
contract BasicToken is Ownable, ERC20Basic { using SafeMath for uint; mapping(address => uint) public balances; // additional variables for use if transaction fees ever became necessary uint public basisPointsRate = 0; uint public maximumFee = 0; /** * @dev Fix for the ERC20 sho...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
balanceOf
function balanceOf(address _owner) public constant returns (uint balance) { return balances[_owner]; }
/** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint representing the amount owned by the passed address. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 1427, 1548 ] }
8,426
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
StandardToken
contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) public allowed; uint public constant MAX_UINT = 2**256 - 1; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @par...
/** * @title Standard ERC20 token * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
transferFrom
function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; uint fee = (_valu...
/** * @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 uint the amount of tokens to be transferred */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 451, 1367 ] }
8,427
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
StandardToken
contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) public allowed; uint public constant MAX_UINT = 2**256 - 1; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @par...
/** * @title Standard ERC20 token * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
approve
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) { // 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://git...
/** * @dev Approve 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.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 1609, 2192 ] }
8,428
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
StandardToken
contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) public allowed; uint public constant MAX_UINT = 2**256 - 1; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @par...
/** * @title Standard ERC20 token * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
allowance
function allowance(address _owner, address _spender) public constant returns (uint remaining) { return allowed[_owner][_spender]; }
/** * @dev Function to check the amount of tokens than 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 uint specifying the amount of tokens still available for the spender. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 2520, 2670 ] }
8,429
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
UpgradedStandardToken
contract UpgradedStandardToken is StandardToken{ // those methods are called by the legacy contract // and they must ensure msg.sender to be the contract address function transferByLegacy(address from, address to, uint value) public; function transferFromByLegacy(address sender, address from, addres...
transferByLegacy
function transferByLegacy(address from, address to, uint value) public;
// those methods are called by the legacy contract // and they must ensure msg.sender to be the contract address
LineComment
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 173, 249 ] }
8,430
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
MexaCoin
contract MexaCoin is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // Inicializa el contrato con el suministro inicial de monedas al creador // // @param _initia...
transfer
function transfer(address _to, uint _value) public whenNotPaused { require(!isBlackListed[msg.sender]); require(!isBlackListed[_to]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value); } else { return super.transfer(_to, _valu...
// Transferencias entre direcciones // Requiere que ni el emisor ni el receptor esten en la lista negra // Suspende actividades cuando el contrato se encuentra en pausa // Utiliza ERC20.sol para actualizar el contrato si el actual llega a ser obsoleto // // @param _to Direccion a la que se envian las mone...
LineComment
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 1275, 1645 ] }
8,431
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
MexaCoin
contract MexaCoin is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // Inicializa el contrato con el suministro inicial de monedas al creador // // @param _initia...
balanceOf
function balanceOf(address who) public constant returns (uint) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).balanceOf(who); } else { return super.balanceOf(who); } }
// Refleja el balance de una direccion // Utiliza ERC20.sol para actualizar el contrato si el actual llega a ser obsoleto // // @param who Direccion a consultar
LineComment
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 1843, 2092 ] }
8,432
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
MexaCoin
contract MexaCoin is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // Inicializa el contrato con el suministro inicial de monedas al creador // // @param _initia...
transferFrom
function transferFrom(address _from, address _to, uint _value) public whenNotPaused { require(!isBlackListed[_from]); require(!isBlackListed[_to]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value); } else { return ...
// Transferencias desde direcciones a nombre de terceros (concesiones) // Require que ni el emisor ni el receptor esten en la lista negra // Suspende actividades cuando el contrato se encuentra en pausa // Utiliza ERC20.sol para actualizar el contrato si el actual llega a ser obsoleto // // @param _from Dir...
LineComment
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 2624, 3030 ] }
8,433
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
MexaCoin
contract MexaCoin is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // Inicializa el contrato con el suministro inicial de monedas al creador // // @param _initia...
approve
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) whenNotPaused { require(!isBlackListed[msg.sender]); require(!isBlackListed[_spender]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value); } else { ...
// Permite genera concesiones a direcciones de terceros especificando la direccion y la cantidad de monedas a conceder // Require que ni el emisor ni el receptor esten en la lista negra // Suspende actividades cuando el contrato se encuentra en pausa // Utiliza ERC20.sol para actualizar el contrato si el actual llega a...
LineComment
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 3538, 3949 ] }
8,434
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
MexaCoin
contract MexaCoin is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // Inicializa el contrato con el suministro inicial de monedas al creador // // @param _initia...
allowance
function allowance(address _owner, address _spender) public constant returns (uint remaining) { if (deprecated) { return StandardToken(upgradedAddress).allowance(_owner, _spender); } else { return super.allowance(_owner, _spender); } }
// Refleja cantidad de moendas restantes en concesion // Utiliza ERC20.sol para actualizar el contrato si el actual llega a ser obsoleto // // @param _owner Direccion de quien concede las monedas // @param _spender Direccion que posee la concesion
LineComment
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 4245, 4543 ] }
8,435
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
MexaCoin
contract MexaCoin is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // Inicializa el contrato con el suministro inicial de monedas al creador // // @param _initia...
deprecate
function deprecate(address _upgradedAddress) public onlyOwner { deprecated = true; upgradedAddress = _upgradedAddress; emit Deprecate(_upgradedAddress); }
// Suspende el actual contrato a favor de uno nuevo // // @param _upgradedAddress Direccion del nuevo contrato
LineComment
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 4673, 4864 ] }
8,436
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
MexaCoin
contract MexaCoin is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // Inicializa el contrato con el suministro inicial de monedas al creador // // @param _initia...
totalSupply
function totalSupply() public constant returns (uint) { if (deprecated) { return StandardToken(upgradedAddress).totalSupply(); } else { return _totalSupply; } }
// Refleja la cantidad total de monedas generada por el contrato //
LineComment
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 4945, 5168 ] }
8,437
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
MexaCoin
contract MexaCoin is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // Inicializa el contrato con el suministro inicial de monedas al creador // // @param _initia...
issue
function issue(uint amount) public onlyOwner { require(_totalSupply + amount > _totalSupply); require(balances[owner] + amount > balances[owner]); balances[owner] += amount; _totalSupply += amount; emit Issue(amount); }
// Genera nuevas monedas y las deposita en la direccion del creador // // @param _amount Numero de monedas a generar
LineComment
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 5313, 5589 ] }
8,438
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
MexaCoin
contract MexaCoin is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // Inicializa el contrato con el suministro inicial de monedas al creador // // @param _initia...
redeem
function redeem(uint amount) public onlyOwner { require(_totalSupply >= amount); require(balances[owner] >= amount); _totalSupply -= amount; balances[owner] -= amount; emit Redeem(amount); }
// Retiro de monedas // Las moendas son retiradas de la cuenta del creador // El balance en la cuenta debe ser suficiente para completar la transaccion de lo contrario se generara un error // @param _amount Nuemro de monedas a retirar
LineComment
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 5857, 6104 ] }
8,439
MexaCoin
MexaCoin.sol
0xdea8e7d3b9e422073a69615b998b34533b7bf898
Solidity
MexaCoin
contract MexaCoin is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // Inicializa el contrato con el suministro inicial de monedas al creador // // @param _initia...
setParams
function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner { // Asegura el valor maximo que no podran sobrepasar las cuotas require(newBasisPoints < 50); require(newMaxFee < 1000); basisPointsRate = newBasisPoints; maximumFee = newMaxFee.mul(10**decimals); emit Params(bas...
// Establece el valor de las cuotas en caso de existir // // @param newBasisPoints Cuota base // @param newMaxFee Cuota maxima
LineComment
v0.4.23+commit.124ca40d
bzzr://04111d1f568ec95779355af636ec353af628df58bdacfea0d06838231cd882be
{ "func_code_index": [ 6269, 6651 ] }
8,440
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
_baseURI
function _baseURI() internal view override returns (string memory) { if (mintStep == 4) // Reveal return realBaseURI; return placeholderBaseURI; }
/** * Override _baseURI * mintStep: 0~3 - Unreveal * 4 - Reveal */
NatSpecMultiLine
v0.8.10+commit.fc410830
{ "func_code_index": [ 3104, 3301 ] }
8,441
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
tokenURI
function tokenURI(uint256 tokenId) public view override returns (string memory) { require(_exists(tokenId), "Token does not exist"); return string(abi.encodePacked(_baseURI(), Strings.toString(tokenId), ".json")); }
/** * Override tokenURI */
NatSpecMultiLine
v0.8.10+commit.fc410830
{ "func_code_index": [ 3348, 3591 ] }
8,442
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
_leaf
function _leaf(address account) private pure returns (bytes32) { return keccak256(abi.encodePacked(account)); }
/** * Address -> leaf for MerkleTree */
NatSpecMultiLine
v0.8.10+commit.fc410830
{ "func_code_index": [ 3651, 3781 ] }
8,443
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
verifyWhitelist
function verifyWhitelist(bytes32 leaf, bytes32[] memory proof) private view returns (bool) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash < proofElement) { // Hash(current computed hash + current ...
/** * Verify WhiteList using MerkleTree */
NatSpecMultiLine
v0.8.10+commit.fc410830
{ "func_code_index": [ 3844, 4644 ] }
8,444
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
mintFreeSecret
function mintFreeSecret(uint8 _mintCount) external nonReentrant returns (uint256) { require(mintStep == 0 && _mintCount > 0 && _mintCount <= LIMIT2); require(msg.sender != address(0)); require(addressFreeMintCountMap[msg.sender] + _mintCount <= LIMIT2); require(_mintCount <= secretFreeMint...
/** * Secret Free Mint * mintStep: 0 * mintCount: Up to 2 */
NatSpecMultiLine
v0.8.10+commit.fc410830
{ "func_code_index": [ 4742, 5752 ] }
8,445
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
mintFreeNormal
function mintFreeNormal(uint8 _mintCount, bytes32[] memory _proof) external nonReentrant returns (uint256) { require(mintStep == 0 && _mintCount > 0 && _mintCount <= LIMIT2); require(msg.sender != address(0)); require(addressFreeMintCountMap[msg.sender] + _mintCount <= LIMIT2); require(_mi...
/** * Secret Free Mint * mintStep: 0 * mintCount: Up to 2 */
NatSpecMultiLine
v0.8.10+commit.fc410830
{ "func_code_index": [ 5850, 6948 ] }
8,446
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
mintPresale
function mintPresale(uint8 _mintCount, bytes32[] memory _proof) external payable nonReentrant returns (uint256) { require(_mintCount > 0 && _mintCount <= LIMIT2); require(msg.sender != address(0)); require(addressPreSaleCountMap[msg.sender] + _mintCount <= LIMIT2); require(( // Presa...
/** * Presale with WhiteList * mintStep: 1: discount * 2: normal * mintCount: Up to 2 */
NatSpecMultiLine
v0.8.10+commit.fc410830
{ "func_code_index": [ 7093, 8683 ] }
8,447
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
mintPublic
function mintPublic(uint8 _mintCount) external payable nonReentrant returns (uint256) { require(mintStep == 3 && _mintCount > 0 && _mintCount <= LIMIT5); require(msg.sender != address(0)); require(msg.value == (mintPrice * _mintCount)); require(addressPublicSaleCountMap[msg.sender] + _mint...
/** * Public Sale * mintStep: 3 * mintCount: Up to 5 */
NatSpecMultiLine
v0.8.10+commit.fc410830
{ "func_code_index": [ 8776, 9800 ] }
8,448
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
setMintStep
function setMintStep(uint8 _mintStep) external onlyOwner returns (uint8) { require(_mintStep >= 0 && _mintStep <= 5); mintStep = _mintStep; emit Setting(mintStep, mintPrice, mintPriceDiscount, totalLimit, LIMIT5, LIMIT2); return mintStep; }
/** * Set status of mintStep * mintStep: 0 - freeMint, * 1 - preSale 1: discount, * 2 - preSale 2: normal, * 3 - publicSale, * 4 - reveal, * 5 - paused */
NatSpecMultiLine
v0.8.10+commit.fc410830
{ "func_code_index": [ 10080, 10366 ] }
8,449
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
getBalance
function getBalance() external view onlyOwner returns (uint256) { return address(this).balance; }
// Get Balance
LineComment
v0.8.10+commit.fc410830
{ "func_code_index": [ 10389, 10505 ] }
8,450
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
withdraw
function withdraw() external onlyOwner { require(address(this).balance != 0); uint256 balance = address(this).balance; for (uint8 i = 0; i < teamWalletList.length; i++) { payable(teamWalletList[i]).transfer(balance.div(100).mul(teamWalletPercent[teamWalletList[i]])); } }
// Withdraw
LineComment
v0.8.10+commit.fc410830
{ "func_code_index": [ 10529, 10871 ] }
8,451
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
setRealBaseURI
function setRealBaseURI(string memory _realBaseURI) external onlyOwner returns (string memory) { realBaseURI = _realBaseURI; return realBaseURI; }
/// Set Methods
NatSpecSingleLine
v0.8.10+commit.fc410830
{ "func_code_index": [ 10895, 11069 ] }
8,452
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
getTokenList
function getTokenList(address account) external view returns (uint256[] memory) { require(msg.sender != address(0)); require(account != address(0)); address selectedAccount = msg.sender; if (owner() == msg.sender) selectedAccount = account; uint256 count = balanceOf(selectedAccount...
/** * Get TokenList by sender */
NatSpecMultiLine
v0.8.10+commit.fc410830
{ "func_code_index": [ 11494, 12281 ] }
8,453
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
getSetting
function getSetting() external view returns (uint256[] memory) { uint256[] memory setting = new uint256[](6); setting[0] = mintStep; setting[1] = mintPrice; setting[2] = mintPriceDiscount; setting[3] = totalLimit; setting[4] = LIMIT5; setting[5] = LIMIT2; return setting; }
/** * Get Setting * 0 : mintStep * 1 : mintPrice * 2 : mintPriceDiscount * 3 : totalLimit * 4 : LIMIT5 * 5 : LIMIT2 */
NatSpecMultiLine
v0.8.10+commit.fc410830
{ "func_code_index": [ 12486, 12841 ] }
8,454
ratDAO
contracts/ratDAO.sol
0x43a10115280634d788815cd9316df1d07c92e1c5
Solidity
ratDAO
contract ratDAO is ERC721, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath for uint16; using SafeMath for uint8; uint16 private _tokenId; // Team wallet address [] teamWalletList = [ 0x0CC494215f952b7cD96378D803a0D3a6CAb282b0, // Wallet 1 address...
/// @title A contract for ratDAO /// @author Phillip /// @notice NFT Minting
NatSpecSingleLine
getAccountStatus
function getAccountStatus(address account) external view returns (uint8[] memory) { require(msg.sender != address(0)); require(account != address(0)); address selectedAccount = msg.sender; if (owner() == msg.sender) selectedAccount = account; uint8[] memory status = new uint8[](3);...
/** * Get Status by sender * 0 : freeMintCount * 1 : presaleCount * 2 : publicSaleCount */
NatSpecMultiLine
v0.8.10+commit.fc410830
{ "func_code_index": [ 12985, 13642 ] }
8,455
AccessToken
AccessToken.sol
0x11229b2fa7ba8f1cee0bd9d11913f7f01201cbe2
Solidity
Token
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// ...
totalSupply
function totalSupply() constant returns (uint256 supply) {}
/// @return total amount of tokens
NatSpecSingleLine
v0.4.24+commit.e67f0147
bzzr://d93aac7fb23f70405f229d31f202122b15740391c9681d5310df791da57cc4ff
{ "func_code_index": [ 60, 124 ] }
8,456
AccessToken
AccessToken.sol
0x11229b2fa7ba8f1cee0bd9d11913f7f01201cbe2
Solidity
Token
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// ...
balanceOf
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @param _owner The address from which the balance will be retrieved /// @return The balance
NatSpecSingleLine
v0.4.24+commit.e67f0147
bzzr://d93aac7fb23f70405f229d31f202122b15740391c9681d5310df791da57cc4ff
{ "func_code_index": [ 232, 309 ] }
8,457
AccessToken
AccessToken.sol
0x11229b2fa7ba8f1cee0bd9d11913f7f01201cbe2
Solidity
Token
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// ...
transfer
function transfer(address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not
NatSpecSingleLine
v0.4.24+commit.e67f0147
bzzr://d93aac7fb23f70405f229d31f202122b15740391c9681d5310df791da57cc4ff
{ "func_code_index": [ 546, 623 ] }
8,458
AccessToken
AccessToken.sol
0x11229b2fa7ba8f1cee0bd9d11913f7f01201cbe2
Solidity
Token
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// ...
transferFrom
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not
NatSpecSingleLine
v0.4.24+commit.e67f0147
bzzr://d93aac7fb23f70405f229d31f202122b15740391c9681d5310df791da57cc4ff
{ "func_code_index": [ 946, 1042 ] }
8,459
AccessToken
AccessToken.sol
0x11229b2fa7ba8f1cee0bd9d11913f7f01201cbe2
Solidity
Token
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// ...
approve
function approve(address _spender, uint256 _value) returns (bool success) {}
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of wei to be approved for transfer /// @return Whether the approval was successful or not
NatSpecSingleLine
v0.4.24+commit.e67f0147
bzzr://d93aac7fb23f70405f229d31f202122b15740391c9681d5310df791da57cc4ff
{ "func_code_index": [ 1326, 1407 ] }
8,460
AccessToken
AccessToken.sol
0x11229b2fa7ba8f1cee0bd9d11913f7f01201cbe2
Solidity
Token
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// ...
allowance
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
/// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent
NatSpecSingleLine
v0.4.24+commit.e67f0147
bzzr://d93aac7fb23f70405f229d31f202122b15740391c9681d5310df791da57cc4ff
{ "func_code_index": [ 1615, 1712 ] }
8,461
AccessToken
AccessToken.sol
0x11229b2fa7ba8f1cee0bd9d11913f7f01201cbe2
Solidity
AccessToken
contract AccessToken is StandardToken { /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces ...
AccessToken
function AccessToken() { balances[msg.sender] = 10000000000000000000000000000; totalSupply = 10000000000000000000000000000; name = "AccessToken"; decimals = 18; symbol = "ACT"; unitsOneEthCanBuy = 100000000; fundsWallet = msg.sender; }
// Where should the raised ETH go? // which means the following function name has to match the contract name declared above
LineComment
v0.4.24+commit.e67f0147
bzzr://d93aac7fb23f70405f229d31f202122b15740391c9681d5310df791da57cc4ff
{ "func_code_index": [ 1120, 1428 ] }
8,462
AccessToken
AccessToken.sol
0x11229b2fa7ba8f1cee0bd9d11913f7f01201cbe2
Solidity
AccessToken
contract AccessToken is StandardToken { /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces ...
approveAndCall
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); //call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually s...
/* Approves and then calls the receiving contract */
Comment
v0.4.24+commit.e67f0147
bzzr://d93aac7fb23f70405f229d31f202122b15740391c9681d5310df791da57cc4ff
{ "func_code_index": [ 2024, 2829 ] }
8,463
MoonieNFT
contracts/common/lib/MerklePatriciaProof.sol
0x744418761efbd3e7239d76e429d6df7f18fca590
Solidity
MerklePatriciaProof
library MerklePatriciaProof { /* * @dev Verifies a merkle patricia proof. * @param value The terminating value in the trie. * @param encodedPath The path in the trie leading to value. * @param rlpParentNodes The rlp encoded stack of nodes. * @param root The root hash of the trie. ...
verify
function verify( bytes memory value, bytes memory encodedPath, bytes memory rlpParentNodes, bytes32 root ) internal pure returns (bool) { RLPReader.RLPItem memory item = RLPReader.toRlpItem(rlpParentNodes); RLPReader.RLPItem[] memory parentNodes = RLPReader.toList(item); bytes memo...
/* * @dev Verifies a merkle patricia proof. * @param value The terminating value in the trie. * @param encodedPath The path in the trie leading to value. * @param rlpParentNodes The rlp encoded stack of nodes. * @param root The root hash of the trie. * @return The boolean validity of the proof. */
Comment
v0.8.4+commit.c7e474f2
MIT
ipfs://e272d0561e5d257fa285f8fe8be939eea21aea62940820517462c2d69edbff82
{ "func_code_index": [ 377, 3120 ] }
8,464
MoonieNFT
contracts/common/lib/MerklePatriciaProof.sol
0x744418761efbd3e7239d76e429d6df7f18fca590
Solidity
MerklePatriciaProof
library MerklePatriciaProof { /* * @dev Verifies a merkle patricia proof. * @param value The terminating value in the trie. * @param encodedPath The path in the trie leading to value. * @param rlpParentNodes The rlp encoded stack of nodes. * @param root The root hash of the trie. ...
_getNibbleArray
function _getNibbleArray(bytes memory b) internal pure returns (bytes memory) { bytes memory nibbles = ""; if (b.length > 0) { uint8 offset; uint8 hpNibble = uint8(_getNthNibbleOfBytes(0, b)); if (hpNibble == 1 || hpNibble == 3) { nibbles = new bytes(b.l...
// bytes b must be hp encoded
LineComment
v0.8.4+commit.c7e474f2
MIT
ipfs://e272d0561e5d257fa285f8fe8be939eea21aea62940820517462c2d69edbff82
{ "func_code_index": [ 4144, 4976 ] }
8,465
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
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...
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.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 251, 437 ] }
8,466
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
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...
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; 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. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 707, 896 ] }
8,467
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
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...
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; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 1142, 1617 ] }
8,468
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
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...
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath: division by zero"); 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 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 reve...
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 2080, 2418 ] }
8,469
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
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...
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; }
/** * @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 (consumi...
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 2870, 3027 ] }
8,470
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 94, 154 ] }
8,471
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 237, 310 ] }
8,472
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 534, 616 ] }
8,473
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
allowance
function allowance(address owner, address spender) external view returns (uint256);
/** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through `transferFrom`. This is * zero by default. * * This value changes when `approve` or `transferFrom` are called. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 895, 983 ] }
8,474
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
approve
function approve(address spender, uint256 amount) external returns (bool);
/** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * > Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * trans...
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 1638, 1717 ] }
8,475
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 2030, 2132 ] }
8,476
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
name
function name() public view returns (string memory) { return _name; }
/** * @dev Returns the name of the token. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 1030, 1118 ] }
8,477
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
symbol
function symbol() public view returns (string memory) { return _symbol; }
/** * @dev Returns the symbol of the token, usually a shorter version of the * name. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 1232, 1324 ] }
8,478
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
decimals
function decimals() public view returns (uint8) { return _decimals; }
/** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. * *...
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 1888, 1976 ] }
8,479
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
totalSupply
function totalSupply() public view returns (uint256) { return _totalSupply; }
/** * @dev See `IERC20.totalSupply`. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 2034, 2130 ] }
8,480
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
balanceOf
function balanceOf(address account) public view returns (uint256) { return _balances[account]; }
/** * @dev See `IERC20.balanceOf`. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 2188, 2303 ] }
8,481
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
transfer
function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(msg.sender, recipient, amount); return true; }
/** * @dev See `IERC20.transfer`. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 2511, 2672 ] }
8,482
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
allowance
function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See `IERC20.allowance`. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 2730, 2869 ] }
8,483
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
approve
function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; }
/** * @dev See `IERC20.approve`. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 3011, 3164 ] }
8,484
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; }
/** * @dev See `IERC20.transferFrom`. * * Emits an `Approval` event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of `ERC20`; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `valu...
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 3630, 3891 ] }
8,485
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; }
/** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 4295, 4506 ] }
8,486
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; }
/** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 5004, 5225 ] }
8,487
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
function () external payable { require(msg.value > 0); _pre_sale_list[msg.sender] = _pre_sale_list[msg.sender].add(msg.value); _owner.transfer(msg.value); emit AddPreSaleList( msg.sender, address(this), msg.value);
/** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to `transfer`, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a `Transfer` event. * * Requirements: * * - `sender` cannot be the zero address. *...
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 5710, 5973 ] }
8,488
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
_transfer
function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] ...
/** * Transfer token **/
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 6014, 6448 ] }
8,489
YFRocket
YFRocket.sol
0xc4776a7a2d88d5dcb36d58a4de738f5fac410f6f
Solidity
YFRocket
contract YFRocket is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; ...
_approve
function _approve(address owner, address spender, uint256 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); }
/** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an `Approval` event. * * Requirements: * * - `owner` cannot be the zero...
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7cd836ec52f82b65db85c45a4f0e6cc0a2a9cf9ed4914343288a6a090bf4ac75
{ "func_code_index": [ 6881, 7221 ] }
8,490
ICPRToken
@openzeppelin/contracts/drafts/ERC20Permit.sol
0x2eb007970aaf70d4a9ea485e1795fa9355a8c0f2
Solidity
ERC20Permit
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping(address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private immutable _PERMIT_TYPEHASH = keccak256("Permit(address owner,address ...
/** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message sig...
NatSpecMultiLine
permit
function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual override { // solhint-disable-next-line not-rely-on-time require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 st...
/** * @dev See {IERC20Permit-permit}. */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
ipfs://14f2e5781094bf60c378c0d3950de0d2ef7ee3fa8e839eafd3083c01ef564497
{ "func_code_index": [ 728, 1502 ] }
8,491
ICPRToken
@openzeppelin/contracts/drafts/ERC20Permit.sol
0x2eb007970aaf70d4a9ea485e1795fa9355a8c0f2
Solidity
ERC20Permit
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping(address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private immutable _PERMIT_TYPEHASH = keccak256("Permit(address owner,address ...
/** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message sig...
NatSpecMultiLine
nonces
function nonces(address owner) public view override returns (uint256) { return _nonces[owner].current(); }
/** * @dev See {IERC20Permit-nonces}. */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
ipfs://14f2e5781094bf60c378c0d3950de0d2ef7ee3fa8e839eafd3083c01ef564497
{ "func_code_index": [ 1563, 1688 ] }
8,492
ICPRToken
@openzeppelin/contracts/drafts/ERC20Permit.sol
0x2eb007970aaf70d4a9ea485e1795fa9355a8c0f2
Solidity
ERC20Permit
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping(address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private immutable _PERMIT_TYPEHASH = keccak256("Permit(address owner,address ...
/** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message sig...
NatSpecMultiLine
DOMAIN_SEPARATOR
function DOMAIN_SEPARATOR() external view override returns (bytes32) { return _domainSeparatorV4(); }
// solhint-disable-next-line func-name-mixedcase
LineComment
v0.7.6+commit.7338295f
MIT
ipfs://14f2e5781094bf60c378c0d3950de0d2ef7ee3fa8e839eafd3083c01ef564497
{ "func_code_index": [ 1813, 1933 ] }
8,493
CoreVault
contracts/CoreVault.sol
0x78aa057b7bf61092c6dbcafee728554b1a8d2f7c
Solidity
CoreVault
contract CoreVault is OwnableUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // //...
// Core Vault distributes fees equally amongst staked pools // Have fun reading it. Hopefully it's bug-free. God bless.
LineComment
averageFeesPerBlockSinceStart
function averageFeesPerBlockSinceStart() external view returns (uint averagePerBlock) { averagePerBlock = cumulativeRewardsSinceStart.add(rewardsInThisEpoch).div(block.number.sub(contractStartBlock)); }
// Returns fees generated since start of this contract
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://fee948e0c253e51091a11a1674c7b7bfa37bff4ed79331560473d54d03c5af25
{ "func_code_index": [ 2147, 2376 ] }
8,494
CoreVault
contracts/CoreVault.sol
0x78aa057b7bf61092c6dbcafee728554b1a8d2f7c
Solidity
CoreVault
contract CoreVault is OwnableUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // //...
// Core Vault distributes fees equally amongst staked pools // Have fun reading it. Hopefully it's bug-free. God bless.
LineComment
averageFeesPerBlockEpoch
function averageFeesPerBlockEpoch() external view returns (uint256 averagePerBlock) { averagePerBlock = rewardsInThisEpoch.div(block.number.sub(epochCalculationStartBlock)); }
// Returns averge fees in this epoch
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://fee948e0c253e51091a11a1674c7b7bfa37bff4ed79331560473d54d03c5af25
{ "func_code_index": [ 2421, 2615 ] }
8,495
CoreVault
contracts/CoreVault.sol
0x78aa057b7bf61092c6dbcafee728554b1a8d2f7c
Solidity
CoreVault
contract CoreVault is OwnableUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // //...
// Core Vault distributes fees equally amongst staked pools // Have fun reading it. Hopefully it's bug-free. God bless.
LineComment
startNewEpoch
function startNewEpoch() public { require(epochCalculationStartBlock + 50000 < block.number, "New epoch not ready yet"); // About a week epochRewards[epoch] = rewardsInThisEpoch; cumulativeRewardsSinceStart = cumulativeRewardsSinceStart.add(rewardsInThisEpoch); rewardsInThisEpoch = 0; epochCalc...
//Starts a new calculation epoch // Because averge since start will not be accurate
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://fee948e0c253e51091a11a1674c7b7bfa37bff4ed79331560473d54d03c5af25
{ "func_code_index": [ 2816, 3219 ] }
8,496
CoreVault
contracts/CoreVault.sol
0x78aa057b7bf61092c6dbcafee728554b1a8d2f7c
Solidity
CoreVault
contract CoreVault is OwnableUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // //...
// Core Vault distributes fees equally amongst staked pools // Have fun reading it. Hopefully it's bug-free. God bless.
LineComment
add
function add( uint256 _allocPoint, IERC20 _token, bool _withUpdate, bool _withdrawable ) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { require(poolInfo[pid].token != _...
// Add a new token pool. Can only be called by the owner. // Note contract owner is meant to be a governance contract allowing CORE governance consensus
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://fee948e0c253e51091a11a1674c7b7bfa37bff4ed79331560473d54d03c5af25
{ "func_code_index": [ 4226, 4947 ] }
8,497
CoreVault
contracts/CoreVault.sol
0x78aa057b7bf61092c6dbcafee728554b1a8d2f7c
Solidity
CoreVault
contract CoreVault is OwnableUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // //...
// Core Vault distributes fees equally amongst staked pools // Have fun reading it. Hopefully it's bug-free. God bless.
LineComment
set
function set( uint256 _pid, uint256 _allocPoint, bool _withUpdate ) public onlyOwner { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add( _allocPoint ); poolInfo[_pid].allocPoint = _allocPoint...
// Update the given pool's COREs allocation point. Can only be called by the owner. // Note contract owner is meant to be a governance contract allowing CORE governance consensus
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://fee948e0c253e51091a11a1674c7b7bfa37bff4ed79331560473d54d03c5af25
{ "func_code_index": [ 5145, 5522 ] }
8,498
CoreVault
contracts/CoreVault.sol
0x78aa057b7bf61092c6dbcafee728554b1a8d2f7c
Solidity
CoreVault
contract CoreVault is OwnableUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // //...
// Core Vault distributes fees equally amongst staked pools // Have fun reading it. Hopefully it's bug-free. God bless.
LineComment
setPoolWithdrawable
function setPoolWithdrawable( uint256 _pid, bool _withdrawable ) public onlyOwner { poolInfo[_pid].withdrawable = _withdrawable; }
// Update the given pool's ability to withdraw tokens // Note contract owner is meant to be a governance contract allowing CORE governance consensus
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://fee948e0c253e51091a11a1674c7b7bfa37bff4ed79331560473d54d03c5af25
{ "func_code_index": [ 5684, 5856 ] }
8,499
CoreVault
contracts/CoreVault.sol
0x78aa057b7bf61092c6dbcafee728554b1a8d2f7c
Solidity
CoreVault
contract CoreVault is OwnableUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // //...
// Core Vault distributes fees equally amongst staked pools // Have fun reading it. Hopefully it's bug-free. God bless.
LineComment
pendingCore
function pendingCore(uint256 _pid, address _user) public view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accCorePerShare = pool.accCorePerShare; return user.amount.mul(accCorePerShare).div(1e12).sub(user.reward...
// View function to see pending COREs on frontend.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://fee948e0c253e51091a11a1674c7b7bfa37bff4ed79331560473d54d03c5af25
{ "func_code_index": [ 6306, 6676 ] }
8,500
CoreVault
contracts/CoreVault.sol
0x78aa057b7bf61092c6dbcafee728554b1a8d2f7c
Solidity
CoreVault
contract CoreVault is OwnableUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // //...
// Core Vault distributes fees equally amongst staked pools // Have fun reading it. Hopefully it's bug-free. God bless.
LineComment
massUpdatePools
function massUpdatePools() public { console.log("Mass Updating Pools"); uint256 length = poolInfo.length; uint allRewards; for (uint256 pid = 0; pid < length; ++pid) { allRewards = allRewards.add(updatePool(pid)); } pendingRewards = pendingRewards.sub(allRewards); }
// Update reward vairables for all pools. Be careful of gas spending!
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://fee948e0c253e51091a11a1674c7b7bfa37bff4ed79331560473d54d03c5af25
{ "func_code_index": [ 6754, 7099 ] }
8,501
CoreVault
contracts/CoreVault.sol
0x78aa057b7bf61092c6dbcafee728554b1a8d2f7c
Solidity
CoreVault
contract CoreVault is OwnableUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // //...
// Core Vault distributes fees equally amongst staked pools // Have fun reading it. Hopefully it's bug-free. God bless.
LineComment
updatePool
function updatePool(uint256 _pid) internal returns (uint256 coreRewardWhole) { PoolInfo storage pool = poolInfo[_pid]; uint256 tokenSupply = pool.token.balanceOf(address(this)); if (tokenSupply == 0) { // avoids division by 0 errors return 0; } coreRewardWhole = pendingRewards // Mul...
// Update reward variables of the given pool to be up-to-date.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://fee948e0c253e51091a11a1674c7b7bfa37bff4ed79331560473d54d03c5af25
{ "func_code_index": [ 7731, 8738 ] }
8,502
CoreVault
contracts/CoreVault.sol
0x78aa057b7bf61092c6dbcafee728554b1a8d2f7c
Solidity
CoreVault
contract CoreVault is OwnableUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // //...
// Core Vault distributes fees equally amongst staked pools // Have fun reading it. Hopefully it's bug-free. God bless.
LineComment
deposit
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; massUpdatePools(); // Transfer pending tokens // to user updateAndPayOutPending(_pid, msg.sender); //Transfer in the...
// Deposit tokens to CoreVault for CORE allocation.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://fee948e0c253e51091a11a1674c7b7bfa37bff4ed79331560473d54d03c5af25
{ "func_code_index": [ 8799, 9506 ] }
8,503
CoreVault
contracts/CoreVault.sol
0x78aa057b7bf61092c6dbcafee728554b1a8d2f7c
Solidity
CoreVault
contract CoreVault is OwnableUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // //...
// Core Vault distributes fees equally amongst staked pools // Have fun reading it. Hopefully it's bug-free. God bless.
LineComment
depositFor
function depositFor(address depositFor, uint256 _pid, uint256 _amount) public { // requires no allowances PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][depositFor]; massUpdatePools(); // Transfer pending tokens // to user updateAndPayOutPen...
// Test coverage // [x] Does user get the deposited amounts? // [x] Does user that its deposited for update correcty? // [x] Does the depositor get their tokens decreased
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://fee948e0c253e51091a11a1674c7b7bfa37bff4ed79331560473d54d03c5af25
{ "func_code_index": [ 9700, 10527 ] }
8,504
CoreVault
contracts/CoreVault.sol
0x78aa057b7bf61092c6dbcafee728554b1a8d2f7c
Solidity
CoreVault
contract CoreVault is OwnableUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // //...
// Core Vault distributes fees equally amongst staked pools // Have fun reading it. Hopefully it's bug-free. God bless.
LineComment
setAllowanceForPoolToken
function setAllowanceForPoolToken(address spender, uint256 _pid, uint256 value) public { PoolInfo storage pool = poolInfo[_pid]; pool.allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, _pid, value); }
// Test coverage // [x] Does allowance update correctly?
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://fee948e0c253e51091a11a1674c7b7bfa37bff4ed79331560473d54d03c5af25
{ "func_code_index": [ 10597, 10858 ] }
8,505
CoreVault
contracts/CoreVault.sol
0x78aa057b7bf61092c6dbcafee728554b1a8d2f7c
Solidity
CoreVault
contract CoreVault is OwnableUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // //...
// Core Vault distributes fees equally amongst staked pools // Have fun reading it. Hopefully it's bug-free. God bless.
LineComment
withdrawFrom
function withdrawFrom(address owner, uint256 _pid, uint256 _amount) public{ PoolInfo storage pool = poolInfo[_pid]; require(pool.allowance[owner][msg.sender] >= _amount, "withdraw: insufficient allowance"); pool.allowance[owner][msg.sender] = pool.allowance[owner][msg.sender].sub(_amount); ...
// Test coverage // [x] Does allowance decrease? // [x] Do oyu need allowance // [x] Withdraws to correct address
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://fee948e0c253e51091a11a1674c7b7bfa37bff4ed79331560473d54d03c5af25
{ "func_code_index": [ 10995, 11390 ] }
8,506