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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FlipCoin | FlipCoin.sol | 0xc9d2b0cad0c4a2575234cf773240fd31195fcdc8 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | isContract | function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codeha... | /**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:... | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv2 | bzzr://627899cf8204167aecc429e138abd1a0af33c3a6c48aa8aed48ead71b1f88789 | {
"func_code_index": [
607,
1231
]
} | 18,100 |
FlipCoin | FlipCoin.sol | 0xc9d2b0cad0c4a2575234cf773240fd31195fcdc8 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | toPayable | function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
| /**
* @dev Converts an `address` into `address payable`. Note that this is
* simply a type cast: the actual underlying value is not changed.
*
* _Available since v2.4.0._
*/ | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv2 | bzzr://627899cf8204167aecc429e138abd1a0af33c3a6c48aa8aed48ead71b1f88789 | {
"func_code_index": [
1443,
1575
]
} | 18,101 |
FlipCoin | FlipCoin.sol | 0xc9d2b0cad0c4a2575234cf773240fd31195fcdc8 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | sendValue | function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call.value(amount)("");
require(success, "Address: unable to send value, re... | /**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `tr... | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv2 | bzzr://627899cf8204167aecc429e138abd1a0af33c3a6c48aa8aed48ead71b1f88789 | {
"func_code_index": [
2547,
2923
]
} | 18,102 |
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ERC721 | contract ERC721 {
// Required methods
function approve(address _to, uint256 _tokenId) public;
function balanceOf(address _owner) public view returns (uint256 balance);
function implementsERC721() public pure returns (bool);
function ownerOf(uint256 _tokenId) public view returns (address addr);
functio... | /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete) | NatSpecSingleLine | approve | function approve(address _to, uint256 _tokenId) public;
| // Required methods | LineComment | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
42,
100
]
} | 18,103 | |
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | ThingToken | function ThingToken() public {
ceoAddress = msg.sender;
cooAddress = msg.sender;
}
| /*** CONSTRUCTOR ***/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
2683,
2781
]
} | 18,104 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | approve | function approve(
address _to,
uint256 _tokenId
) public {
// Caller must own token.
require(_owns(msg.sender, _tokenId));
personIndexToApproved[_tokenId] = _to;
Approval(msg.sender, _to, _tokenId);
}
| /// @notice Grant another address the right to transfer token via takeOwnership() and transferFrom().
/// @param _to The address to be granted transfer approval. Pass address(0) to
/// clear all approvals.
/// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
/// @dev Required for ERC-... | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
3165,
3408
]
} | 18,105 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | balanceOf | function balanceOf(address _owner) public view returns (uint256 balance) {
return ownershipTokenCount[_owner];
}
| /// For querying balance of a particular account
/// @param _owner The address for balance query
/// @dev Required for ERC-721 compliance. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
3559,
3682
]
} | 18,106 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | createPromoPerson | function createPromoPerson(address _owner, string _name, uint256 _price) public onlyCOO {
require(promoCreatedCount < PROMO_CREATION_LIMIT);
address personOwner = _owner;
if (personOwner == address(0)) {
personOwner = cooAddress;
}
if (_price <= 0) {
_price = startingPrice;
}
promoC... | /// @dev Creates a new promo Person with the given name, with given _price and assignes it to an address. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
3794,
4202
]
} | 18,107 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | createContractPerson | function createContractPerson(string _name) public onlyCOO {
_createPerson(_name, address(this), startingPrice);
}
| /// @dev Creates a new Person with the given name. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
4259,
4384
]
} | 18,108 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | getPerson | function getPerson(uint256 _tokenId) public view returns (
string personName,
uint256 sellingPrice,
address owner
) {
Person storage person = persons[_tokenId];
personName = person.name;
sellingPrice = personIndexToPrice[_tokenId];
owner = personIndexToOwner[_tokenId];
}
| /// @notice Returns all the relevant information about a specific person.
/// @param _tokenId The tokenId of the person of interest. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
4526,
4841
]
} | 18,109 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | name | function name() public pure returns (string) {
return NAME;
}
| /// @dev Required for ERC-721 compliance. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
4974,
5046
]
} | 18,110 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | ownerOf | function ownerOf(uint256 _tokenId)
public
view
returns (address owner)
{
owner = personIndexToOwner[_tokenId];
require(owner != address(0));
}
| /// For querying owner of token
/// @param _tokenId The tokenID for owner inquiry
/// @dev Required for ERC-721 compliance. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
5182,
5358
]
} | 18,111 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | purchase | function purchase(uint256 _tokenId) public payable {
address oldOwner = personIndexToOwner[_tokenId];
address newOwner = msg.sender;
uint256 sellingPrice = personIndexToPrice[_tokenId];
// Making sure token owner is not sending to self
require(oldOwner != newOwner);
// Safety check to prevent ag... | // Allows someone to send ether and obtain the token | LineComment | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
5495,
7011
]
} | 18,112 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | setCEO | function setCEO(address _newCEO) public onlyCEO {
require(_newCEO != address(0));
ceoAddress = _newCEO;
}
| /// @dev Assigns a new address to act as the CEO. Only available to the current CEO.
/// @param _newCEO The address of the new CEO | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
7276,
7399
]
} | 18,113 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | setCOO | function setCOO(address _newCOO) public onlyCEO {
require(_newCOO != address(0));
cooAddress = _newCOO;
}
| /// @dev Assigns a new address to act as the COO. Only available to the current COO.
/// @param _newCOO The address of the new COO | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
7539,
7662
]
} | 18,114 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | symbol | function symbol() public pure returns (string) {
return SYMBOL;
}
| /// @dev Required for ERC-721 compliance. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
7710,
7786
]
} | 18,115 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | takeOwnership | function takeOwnership(uint256 _tokenId) public {
address newOwner = msg.sender;
address oldOwner = personIndexToOwner[_tokenId];
// Safety check to prevent against an unexpected 0x0 default.
require(_addressNotNull(newOwner));
// Making sure transfer is approved
require(_approved(newOwner, _token... | /// @notice Allow pre-approved user to take ownership of a token
/// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
/// @dev Required for ERC-721 compliance. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
7992,
8385
]
} | 18,116 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | tokensOfOwner | function tokensOfOwner(address _owner) public view returns(uint256[] ownerTokens) {
uint256 tokenCount = balanceOf(_owner);
if (tokenCount == 0) {
// Return an empty array
return new uint256[](0);
} else {
uint256[] memory result = new uint256[](tokenCount);
uint256 totalPersons = totalSu... | /// @param _owner The owner whose celebrity tokens we are interested in.
/// @dev This method MUST NEVER be called by smart contract code. First, it's fairly
/// expensive (it walks the entire Persons array looking for persons belonging to owner),
/// but it also returns a dynamic array, which is only supported for w... | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
8775,
9422
]
} | 18,117 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | totalSupply | function totalSupply() public view returns (uint256 total) {
return persons.length;
}
| /// For querying totalSupply of token
/// @dev Required for ERC-721 compliance. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
9511,
9607
]
} | 18,118 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | transfer | function transfer(
address _to,
uint256 _tokenId
) public {
require(_owns(msg.sender, _tokenId));
require(_addressNotNull(_to));
_transfer(msg.sender, _to, _tokenId);
}
| /// Owner initates the transfer of the token to another account
/// @param _to The address for the token to be transferred to.
/// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
/// @dev Required for ERC-721 compliance. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
9878,
10082
]
} | 18,119 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | transferFrom | function transferFrom(
address _from,
address _to,
uint256 _tokenId
) public {
require(_owns(_from, _tokenId));
require(_approved(_to, _tokenId));
require(_addressNotNull(_to));
_transfer(_from, _to, _tokenId);
}
| /// Third-party initiates transfer of token from address _from to address _to
/// @param _from The address for the token to be transferred from.
/// @param _to The address for the token to be transferred to.
/// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
/// @dev Required for ERC... | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
10437,
10695
]
} | 18,120 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | _addressNotNull | function _addressNotNull(address _to) private pure returns (bool) {
return _to != address(0);
}
| /// Safety check on _to address to prevent against an unexpected 0x0 default. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
10810,
10916
]
} | 18,121 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | _approved | function _approved(address _to, uint256 _tokenId) private view returns (bool) {
return personIndexToApproved[_tokenId] == _to;
}
| /// For checking approval of transfer for address _to | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
10976,
11115
]
} | 18,122 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | _createPerson | function _createPerson(string _name, address _owner, uint256 _price) private {
Person memory _person = Person({
name: _name
});
uint256 newPersonId = persons.push(_person) - 1;
// It's probably never going to happen, 4 billion tokens are A LOT, but
// let's just be 100% sure we never let this happ... | /// For creating Person | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
11145,
11786
]
} | 18,123 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | _owns | function _owns(address claimant, uint256 _tokenId) private view returns (bool) {
return claimant == personIndexToOwner[_tokenId];
}
| /// Check for token ownership | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
11822,
11964
]
} | 18,124 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | _payout | function _payout(address _to) private {
if (_to == address(0)) {
ceoAddress.transfer(this.balance);
} else {
_to.transfer(this.balance);
}
}
| /// For paying out balance on contract | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
12009,
12184
]
} | 18,125 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | Solidity | ThingToken | contract ThingToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new person comes into existence.
event Birth(uint256 tokenId, string name, address owner);
/// @dev The TokenSold event is fired whenever a token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice,... | _transfer | function _transfer(address _from, address _to, uint256 _tokenId) private {
// Since the number of persons is capped to 2^32 we can't overflow this
ownershipTokenCount[_to]++;
//transfer ownership
personIndexToOwner[_tokenId] = _to;
// When creating new persons _from is 0x0, but we can't account that ad... | /// @dev Assigns ownership of a specific Person to an address. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
12253,
12851
]
} | 18,126 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | 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;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbe... | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
| /**
* @dev Multiplies two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
89,
272
]
} | 18,127 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | 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;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbe... | 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 c;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
356,
629
]
} | 18,128 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | 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;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbe... | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
| /**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
744,
860
]
} | 18,129 | |||
ThingToken | ThingToken.sol | 0x7faa3b024d8f3f0d4cfd1719d5b7366aacd59077 | 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;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbe... | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
| /**
* @dev Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://35dfe533235b004f775f1b9db9296356a977ba3dd8b60afb5ea7c1f58ba808ce | {
"func_code_index": [
924,
1060
]
} | 18,130 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | Roles | library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
role.bearer[account] = true;
}
/**
* @dev remove an account's a... | add | function add(Role storage role, address account) internal {
require(account != address(0));
role.bearer[account] = true;
}
| /**
* @dev give an account access to this role
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
141,
279
]
} | 18,131 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | Roles | library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
role.bearer[account] = true;
}
/**
* @dev remove an account's a... | remove | function remove(Role storage role, address account) internal {
require(account != address(0));
role.bearer[account] = false;
}
| /**
* @dev remove an account's access to this role
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
347,
489
]
} | 18,132 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | Roles | library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
role.bearer[account] = true;
}
/**
* @dev remove an account's a... | has | function has(Role storage role, address account)
internal
view
returns (bool)
{
require(account != address(0));
return role.bearer[account];
}
| /**
* @dev check if an account has this role
* @return bool
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
570,
746
]
} | 18,133 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | Pausable | contract Pausable is PauserRole {
event Paused();
event Unpaused();
bool private _paused = false;
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public view returns(bool) {
return _paused;
}
/**
* @dev Modifier to make a function callabl... | paused | function paused() public view returns(bool) {
return _paused;
}
| /**
* @return true if the contract is paused, false otherwise.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
191,
265
]
} | 18,134 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | Pausable | contract Pausable is PauserRole {
event Paused();
event Unpaused();
bool private _paused = false;
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public view returns(bool) {
return _paused;
}
/**
* @dev Modifier to make a function callabl... | pause | function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused();
}
| /**
* @dev called by the owner to pause, triggers stopped state
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
676,
775
]
} | 18,135 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | Pausable | contract Pausable is PauserRole {
event Paused();
event Unpaused();
bool private _paused = false;
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public view returns(bool) {
return _paused;
}
/**
* @dev Modifier to make a function callabl... | unpause | function unpause() public onlyPauser whenPaused {
_paused = false;
emit Unpaused();
}
| /**
* @dev called by the owner to unpause, returns to normal state
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
859,
960
]
} | 18,136 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, 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... | 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... | /**
* @dev Multiplies two numbers, reverts on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
90,
486
]
} | 18,137 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, 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... | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts 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 c;
}
| /**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
598,
877
]
} | 18,138 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, 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... | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
| /**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
992,
1131
]
} | 18,139 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, 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... | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
| /**
* @dev Adds two numbers, reverts on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
1196,
1335
]
} | 18,140 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, 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... | mod | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
| /**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
1470,
1587
]
} | 18,141 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view re... | totalSupply | function totalSupply() public view returns (uint256) {
return _totalSupply;
}
| /**
* @dev Total number of tokens in existence
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
281,
369
]
} | 18,142 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view re... | balanceOf | function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
| /**
* @dev Gets the balance of the specified address.
* @param owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
574,
677
]
} | 18,143 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view re... | allowance | function allowance(
address owner,
address spender
)
public
view
returns (uint256)
{
return _allowed[owner][spender];
}
| /**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
999,
1161
]
} | 18,144 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view re... | transfer | function transfer(address to, uint256 value) public returns (bool) {
require(value <= _balances[msg.sender]);
require(to != address(0));
_balances[msg.sender] = _balances[msg.sender].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(msg.sender, to, value);
return true;
}
| /**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
1317,
1644
]
} | 18,145 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view re... | 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... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
2268,
2497
]
} | 18,146 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view re... | transferFrom | function transferFrom(
address from,
address to,
uint256 value
)
public
returns (bool)
{
require(value <= _balances[from]);
require(value <= _allowed[from][msg.sender]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
... | /**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
2774,
3252
]
} | 18,147 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view re... | 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
* @param spender T... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
3711,
4057
]
} | 18,148 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view re... | 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... | /**
* @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 T... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
4521,
4877
]
} | 18,149 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view re... | _mint | function _mint(address account, uint256 amount) internal {
require(account != 0);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
| /**
* @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 amount The amount that will be created.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
5211,
5458
]
} | 18,150 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view re... | _burn | function _burn(address account, uint256 amount) internal {
require(account != 0);
require(amount <= _balances[account]);
_totalSupply = _totalSupply.sub(amount);
_balances[account] = _balances[account].sub(amount);
emit Transfer(account, address(0), amount);
}
| /**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param amount The amount that will be burnt.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
5676,
5969
]
} | 18,151 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view re... | _burnFrom | function _burnFrom(address account, uint256 amount) internal {
require(amount <= _allowed[account][msg.sender]);
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
_allowed[account][msg.sender] = _allowed[a... | /**
* @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.
* @param account The account whose tokens will be burnt.
* @param amount The amount that will be burnt.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
6282,
6687
]
} | 18,152 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20Detailed | contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string name, string symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @return the name of the token.
*/
funct... | name | function name() public view returns(string) {
return _name;
}
| /**
* @return the name of the token.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
313,
385
]
} | 18,153 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20Detailed | contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string name, string symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @return the name of the token.
*/
funct... | symbol | function symbol() public view returns(string) {
return _symbol;
}
| /**
* @return the symbol of the token.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
441,
517
]
} | 18,154 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20Detailed | contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string name, string symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @return the name of the token.
*/
funct... | decimals | function decimals() public view returns(uint8) {
return _decimals;
}
| /**
* @return the number of decimals of the token.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
585,
664
]
} | 18,155 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20Mintable | contract ERC20Mintable is ERC20, MinterRole {
event MintingFinished();
bool private _mintingFinished = false;
modifier onlyBeforeMintingFinished() {
require(!_mintingFinished);
_;
}
/**
* @return true if the minting is finished.
*/
function mintingFinished() public view returns... | mintingFinished | function mintingFinished() public view returns(bool) {
return _mintingFinished;
}
| /**
* @return true if the minting is finished.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
272,
364
]
} | 18,156 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20Mintable | contract ERC20Mintable is ERC20, MinterRole {
event MintingFinished();
bool private _mintingFinished = false;
modifier onlyBeforeMintingFinished() {
require(!_mintingFinished);
_;
}
/**
* @return true if the minting is finished.
*/
function mintingFinished() public view returns... | mint | function mint(
address to,
uint256 amount
)
public
onlyMinter
onlyBeforeMintingFinished
returns (bool)
{
_mint(to, amount);
return true;
}
| /**
* @dev Function to mint tokens
* @param to The address that will receive the minted tokens.
* @param amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
603,
793
]
} | 18,157 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | ERC20Mintable | contract ERC20Mintable is ERC20, MinterRole {
event MintingFinished();
bool private _mintingFinished = false;
modifier onlyBeforeMintingFinished() {
require(!_mintingFinished);
_;
}
/**
* @return true if the minting is finished.
*/
function mintingFinished() public view returns... | finishMinting | function finishMinting()
public
onlyMinter
onlyBeforeMintingFinished
returns (bool)
{
_mintingFinished = true;
emit MintingFinished();
return true;
}
| /**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
910,
1103
]
} | 18,158 | |||
BoltToken | BoltToken.sol | 0x9f235d23354857efe6c541db92a9ef1877689bcb | Solidity | BoltToken | contract BoltToken is ERC20, ERC20Detailed, ERC20Mintable, ERC20Pausable {
event Burn(
address indexed from,
uint256 value,
address indexed data
);
constructor(address owner)
ERC20Pausable()
ERC20Mintable()
ERC20Detailed("Bolt Token", "BOLT", 18)
ERC20()
public
{
... | burn | function burn(uint256 value, address data) public {
super._burn(msg.sender, value);
emit Burn(msg.sender, value, data);
}
| /**
* @dev Burns a specific amount of tokens with attached data.
* @param value The amount of token to be burned.
* @param data The swap address data.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://e4adfeb416b4c35ba8d26682978b3e92dde312381306105e2c228d283b528ac1 | {
"func_code_index": [
565,
702
]
} | 18,159 | |||
StakingRewards | Pusd.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDStablecoin | contract PUSDStablecoin is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { PUSD, PEGS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private pusdEthOracle;
... | oracle_price | function oracle_price(PriceChoice choice) internal view returns (uint256) {
// Get the ETH / USD price first, and cut it down to 1e6 precision
uint256 eth_usd_price = uint256(eth_usd_pricer.getLatestPrice()).mul(PRICE_PRECISION).div(uint256(10) ** eth_usd_pricer_decimals);
uint256 price_vs_eth;
if (cho... | // Choice = 'PUSD' or 'PEGS' for now | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
4621,
5533
]
} | 18,160 | ||
StakingRewards | Pusd.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDStablecoin | contract PUSDStablecoin is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { PUSD, PEGS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private pusdEthOracle;
... | pusd_price | function pusd_price() public view returns (uint256) {
return oracle_price(PriceChoice.PUSD);
}
| // Returns X PUSD = 1 USD | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
5565,
5675
]
} | 18,161 | ||
StakingRewards | Pusd.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDStablecoin | contract PUSDStablecoin is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { PUSD, PEGS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private pusdEthOracle;
... | pegs_price | function pegs_price() public view returns (uint256) {
return oracle_price(PriceChoice.PEGS);
}
| // Returns X PEGS = 1 USD | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
5707,
5818
]
} | 18,162 | ||
StakingRewards | Pusd.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDStablecoin | contract PUSDStablecoin is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { PUSD, PEGS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private pusdEthOracle;
... | pusd_info | function pusd_info() public view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256) {
return (
oracle_price(PriceChoice.PUSD), // pusd_price()
oracle_price(PriceChoice.PEGS), // pegs_price()
totalSupply(), // totalSupply()
global_collateral_ratio, // glo... | // This is needed to avoid costly repeat calls to different getter functions
// It is cheaper gas-wise to just dump everything and only use some of the info | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
6175,
6844
]
} | 18,163 | ||
StakingRewards | Pusd.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDStablecoin | contract PUSDStablecoin is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { PUSD, PEGS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private pusdEthOracle;
... | globalCollateralValue | function globalCollateralValue() public view returns (uint256) {
uint256 total_collateral_value_d18 = 0;
for (uint i = 0; i < pusd_pools_array.length; i++){
// Exclude null addresses
if (pusd_pools_array[i] != address(0)){
total_collateral_value_d18 = total_collateral_value_d18.ad... | // Iterate through all pusd pools and calculate all value of collateral in all pools globally | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
6945,
7418
]
} | 18,164 | ||
StakingRewards | Pusd.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDStablecoin | contract PUSDStablecoin is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { PUSD, PEGS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private pusdEthOracle;
... | refreshCollateralRatio | function refreshCollateralRatio() public {
require(collateral_ratio_paused == false, "Collateral Ratio has been paused");
uint256 pusd_price_cur = pusd_price();
require(block.timestamp - last_call_time >= refresh_cooldown, "Must wait for the refresh cooldown since last refresh");
// Step increments are... | // Last time the refreshCollateralRatio function was called | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
7692,
8893
]
} | 18,165 | ||
StakingRewards | Pusd.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDStablecoin | contract PUSDStablecoin is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { PUSD, PEGS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private pusdEthOracle;
... | pool_burn_from | function pool_burn_from(address b_address, uint256 b_amount) public onlyPools {
super._burnFrom(b_address, b_amount);
emit PUSDBurned(b_address, msg.sender, b_amount);
}
| // Used by pools when user redeems | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
8988,
9181
]
} | 18,166 | ||
StakingRewards | Pusd.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDStablecoin | contract PUSDStablecoin is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { PUSD, PEGS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private pusdEthOracle;
... | pool_mint | function pool_mint(address m_address, uint256 m_amount) public onlyPools {
super._mint(m_address, m_amount);
emit PUSDMinted(msg.sender, m_address, m_amount);
}
| // This function is what other pusd pools will call to mint new PUSD | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
9257,
9441
]
} | 18,167 | ||
StakingRewards | Pusd.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDStablecoin | contract PUSDStablecoin is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { PUSD, PEGS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private pusdEthOracle;
... | addPool | function addPool(address pool_address) public onlyByOwnerOrGovernance {
require(pusd_pools[pool_address] == false, "address already exists");
pusd_pools[pool_address] = true;
pusd_pools_array.push(pool_address);
}
| // Adds collateral addresses supported, such as tether and busd, must be ERC20 | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
9527,
9773
]
} | 18,168 | ||
StakingRewards | Pusd.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDStablecoin | contract PUSDStablecoin is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { PUSD, PEGS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private pusdEthOracle;
... | removePool | function removePool(address pool_address) public onlyByOwnerOrGovernance {
require(pusd_pools[pool_address] == true, "address doesn't exist already");
delete pusd_pools[pool_address];
for (uint i = 0; i < pusd_pools_array.length; i++){
if (pusd_pools_array[i] == pool_address) {
... | // Remove a pool | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
9797,
10298
]
} | 18,169 | ||
StakingRewards | Pusd.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDStablecoin | contract PUSDStablecoin is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { PUSD, PEGS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private pusdEthOracle;
... | setPUSDEthOracle | function setPUSDEthOracle(address _pusd_oracle_addr, address _weth_address) public onlyByOwnerOrGovernance {
pusd_eth_oracle_address = _pusd_oracle_addr;
pusdEthOracle = UniswapPairOracle(_pusd_oracle_addr);
weth_address = _weth_address;
}
| // Sets the PUSD_ETH Uniswap oracle address | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
11945,
12217
]
} | 18,170 | ||
StakingRewards | Pusd.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDStablecoin | contract PUSDStablecoin is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
enum PriceChoice { PUSD, PEGS }
ChainlinkETHUSDPriceConsumer private eth_usd_pricer;
uint8 private eth_usd_pricer_decimals;
UniswapPairOracle private pusdEthOracle;
... | setPEGSEthOracle | function setPEGSEthOracle(address _pegs_oracle_addr, address _weth_address) public onlyByOwnerOrGovernance {
pegs_eth_oracle_address = _pegs_oracle_addr;
pegsEthOracle = UniswapPairOracle(_pegs_oracle_addr);
weth_address = _weth_address;
}
| // Sets the PEGS_ETH Uniswap oracle address | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
12268,
12539
]
} | 18,171 | ||
StakingRewards | PEGS.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDShares | contract PUSDShares is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public PUSDStablecoinAdd;
uint256 public constant genesis_supply = 3000000... | setOracle | function setOracle(address new_oracle) external onlyByOwnerOrGovernance {
oracle_address = new_oracle;
}
| /* ========== RESTRICTED FUNCTIONS ========== */ | Comment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
2157,
2277
]
} | 18,172 | ||
StakingRewards | PEGS.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDShares | contract PUSDShares is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public PUSDStablecoinAdd;
uint256 public constant genesis_supply = 3000000... | pool_mint | function pool_mint(address m_address, uint256 m_amount) external onlyPools {
if(trackingVotes){
uint32 srcRepNum = numCheckpoints[address(this)];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[address(this)][srcRepNum - 1].votes : 0;
uint96 srcRepNew = add96(srcRepOld, uint96(m_amoun... | // This function is what other pusd pools will call to mint new PEGS (similar to the PUSD mint) | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
3024,
3685
]
} | 18,173 | ||
StakingRewards | PEGS.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDShares | contract PUSDShares is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public PUSDStablecoinAdd;
uint256 public constant genesis_supply = 3000000... | pool_burn_from | function pool_burn_from(address b_address, uint256 b_amount) external onlyPools {
if(trackingVotes){
trackVotes(b_address, address(this), uint96(b_amount));
uint32 srcRepNum = numCheckpoints[address(this)];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[address(this)][srcRepNum - 1].votes : ... | // This function is what other pusd pools will call to burn PEGS | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
3757,
4421
]
} | 18,174 | ||
StakingRewards | PEGS.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDShares | contract PUSDShares is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public PUSDStablecoinAdd;
uint256 public constant genesis_supply = 3000000... | transfer | function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
if(trackingVotes){
// Transfer votes
trackVotes(_msgSender(), recipient, uint96(amount));
}
_transfer(_msgSender(), recipient, amount);
return true;
}
| /* ========== OVERRIDDEN PUBLIC FUNCTIONS ========== */ | Comment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
4593,
4902
]
} | 18,175 | ||
StakingRewards | PEGS.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDShares | contract PUSDShares is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public PUSDStablecoinAdd;
uint256 public constant genesis_supply = 3000000... | getCurrentVotes | function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
| /**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/ | NatSpecMultiLine | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
5593,
5816
]
} | 18,176 | ||
StakingRewards | PEGS.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDShares | contract PUSDShares is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public PUSDStablecoinAdd;
uint256 public constant genesis_supply = 3000000... | getPriorVotes | function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "PEGS::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
... | /**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @r... | NatSpecMultiLine | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
6234,
7424
]
} | 18,177 | ||
StakingRewards | PEGS.sol | 0x6e222c95dd4f7346582cddc02845138a92af59dc | Solidity | PUSDShares | contract PUSDShares is ERC20Custom, AccessControl {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
string public symbol;
string public name;
uint8 public constant decimals = 18;
address public PUSDStablecoinAdd;
uint256 public constant genesis_supply = 3000000... | trackVotes | function trackVotes(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint... | // From compound's _moveDelegates
// Keep track of votes. "Delegates" is a misnomer here | LineComment | v0.6.11+commit.5ef660b1 | None | ipfs://2754aea291d6237c536c520f87848e49c4b7e5af63dbacf5d21b34bd668ba11b | {
"func_code_index": [
7575,
8498
]
} | 18,178 | ||
WeTubeToken | WeTubeToken.sol | 0xbd3adee82458b9ec0389488eba8a4b040d8f860f | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (addre... | TokenERC20 | function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
nam... | /**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://b6cd99ee5f115439ffd7a4a9296662784e3642e98171e9b9abfdefd839398bc3 | {
"func_code_index": [
840,
1385
]
} | 18,179 | |||
WeTubeToken | WeTubeToken.sol | 0xbd3adee82458b9ec0389488eba8a4b040d8f860f | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (addre... | _transfer | function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to])... | /**
* Internal transfer, only can be called by this contract
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://b6cd99ee5f115439ffd7a4a9296662784e3642e98171e9b9abfdefd839398bc3 | {
"func_code_index": [
1469,
2311
]
} | 18,180 | |||
WeTubeToken | WeTubeToken.sol | 0xbd3adee82458b9ec0389488eba8a4b040d8f860f | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (addre... | transfer | function transfer(address _to, uint256 _value) public {
_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.18+commit.9cf6e910 | bzzr://b6cd99ee5f115439ffd7a4a9296662784e3642e98171e9b9abfdefd839398bc3 | {
"func_code_index": [
2517,
2629
]
} | 18,181 | |||
WeTubeToken | WeTubeToken.sol | 0xbd3adee82458b9ec0389488eba8a4b040d8f860f | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (addre... | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
| /**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://b6cd99ee5f115439ffd7a4a9296662784e3642e98171e9b9abfdefd839398bc3 | {
"func_code_index": [
2904,
3205
]
} | 18,182 | |||
WeTubeToken | WeTubeToken.sol | 0xbd3adee82458b9ec0389488eba8a4b040d8f860f | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (addre... | approve | function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
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.18+commit.9cf6e910 | bzzr://b6cd99ee5f115439ffd7a4a9296662784e3642e98171e9b9abfdefd839398bc3 | {
"func_code_index": [
3469,
3645
]
} | 18,183 | |||
WeTubeToken | WeTubeToken.sol | 0xbd3adee82458b9ec0389488eba8a4b040d8f860f | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (addre... | approveAndCall | function approveAndCall(address _spender, uint256 _value, bytes _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 s... | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://b6cd99ee5f115439ffd7a4a9296662784e3642e98171e9b9abfdefd839398bc3 | {
"func_code_index": [
4039,
4391
]
} | 18,184 | |||
WeTubeToken | WeTubeToken.sol | 0xbd3adee82458b9ec0389488eba8a4b040d8f860f | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (addre... | burn | function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _val... | /**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://b6cd99ee5f115439ffd7a4a9296662784e3642e98171e9b9abfdefd839398bc3 | {
"func_code_index": [
4561,
4935
]
} | 18,185 | |||
WeTubeToken | WeTubeToken.sol | 0xbd3adee82458b9ec0389488eba8a4b040d8f860f | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (addre... | burnFrom | function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Sub... | /**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://b6cd99ee5f115439ffd7a4a9296662784e3642e98171e9b9abfdefd839398bc3 | {
"func_code_index": [
5193,
5804
]
} | 18,186 | |||
WeTubeToken | WeTubeToken.sol | 0xbd3adee82458b9ec0389488eba8a4b040d8f860f | Solidity | WeTubeToken | contract WeTubeToken is TokenERC20 {
/* Initializes contract with initial supply tokens to the creator of the contract */
function WeTubeToken(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
} | /******************************************/ | NatSpecMultiLine | WeTubeToken | function WeTubeToken(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
| /* Initializes contract with initial supply tokens to the creator of the contract */ | Comment | v0.4.18+commit.9cf6e910 | bzzr://b6cd99ee5f115439ffd7a4a9296662784e3642e98171e9b9abfdefd839398bc3 | {
"func_code_index": [
130,
310
]
} | 18,187 | |
Shares | Ownable.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor (address initialOwner) {
owner = initialOwner;
... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
... | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) public onlyOwner {
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
| /**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/ | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
526,
681
]
} | 18,188 |
Shares | ERC20.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | ERC20 | abstract contract ERC20 is IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 public override decimals;
constructor(uint8 _decimals) {
decimals = _decimals;
}... | /**
* @dev Implementation of the `IERC20` interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using `_mint`.
* For a generic mechanism see `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to... | NatSpecMultiLine | totalSupply | function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
| /**
* @dev See `IERC20.totalSupply`.
*/ | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
381,
486
]
} | 18,189 |
Shares | ERC20.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | ERC20 | abstract contract ERC20 is IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 public override decimals;
constructor(uint8 _decimals) {
decimals = _decimals;
}... | /**
* @dev Implementation of the `IERC20` interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using `_mint`.
* For a generic mechanism see `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to... | NatSpecMultiLine | balanceOf | function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
| /**
* @dev See `IERC20.balanceOf`.
*/ | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
544,
668
]
} | 18,190 |
Shares | ERC20.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | ERC20 | abstract contract ERC20 is IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 public override decimals;
constructor(uint8 _decimals) {
decimals = _decimals;
}... | /**
* @dev Implementation of the `IERC20` interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using `_mint`.
* For a generic mechanism see `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to... | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) public virtual override 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.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
876,
1054
]
} | 18,191 |
Shares | ERC20.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | ERC20 | abstract contract ERC20 is IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 public override decimals;
constructor(uint8 _decimals) {
decimals = _decimals;
}... | /**
* @dev Implementation of the `IERC20` interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using `_mint`.
* For a generic mechanism see `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to... | NatSpecMultiLine | allowance | function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
| /**
* @dev See `IERC20.allowance`.
*/ | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
1112,
1260
]
} | 18,192 |
Shares | ERC20.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | ERC20 | abstract contract ERC20 is IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 public override decimals;
constructor(uint8 _decimals) {
decimals = _decimals;
}... | /**
* @dev Implementation of the `IERC20` interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using `_mint`.
* For a generic mechanism see `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to... | NatSpecMultiLine | approve | function approve(address spender, uint256 value) public override returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
| /**
* @dev See `IERC20.approve`.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/ | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
1402,
1564
]
} | 18,193 |
Shares | ERC20.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | ERC20 | abstract contract ERC20 is IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 public override decimals;
constructor(uint8 _decimals) {
decimals = _decimals;
}... | /**
* @dev Implementation of the `IERC20` interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using `_mint`.
* For a generic mechanism see `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to... | NatSpecMultiLine | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][msg.sender];
if (currentAllowance < (1 << 255)){
// Only decrease the allowance if it was not set to 'inf... | /**
* @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.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
2030,
2543
]
} | 18,194 |
Shares | ERC20.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | ERC20 | abstract contract ERC20 is IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 public override decimals;
constructor(uint8 _decimals) {
decimals = _decimals;
}... | /**
* @dev Implementation of the `IERC20` interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using `_mint`.
* For a generic mechanism see `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to... | NatSpecMultiLine | _transfer | function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(recipient != address(0));
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] -= amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
| /**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to `transfer`, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a `Transfer` event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
*... | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
3028,
3363
]
} | 18,195 |
Shares | ERC20.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | ERC20 | abstract contract ERC20 is IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 public override decimals;
constructor(uint8 _decimals) {
decimals = _decimals;
}... | /**
* @dev Implementation of the `IERC20` interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using `_mint`.
* For a generic mechanism see `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to... | NatSpecMultiLine | transferAndCall | function transferAndCall(address recipient, uint amount, bytes calldata data) public returns (bool) {
bool success = transfer(recipient, amount);
if (success){
success = IERC677Receiver(recipient).onTokenTransfer(msg.sender, amount, data);
}
return success;
}
| // ERC-677 functionality, can be useful for swapping and wrapping tokens | LineComment | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
3444,
3762
]
} | 18,196 |
Shares | ERC20.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | ERC20 | abstract contract ERC20 is IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 public override decimals;
constructor(uint8 _decimals) {
decimals = _decimals;
}... | /**
* @dev Implementation of the `IERC20` interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using `_mint`.
* For a generic mechanism see `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to... | NatSpecMultiLine | _mint | function _mint(address recipient, uint256 amount) internal virtual {
require(recipient != address(0));
_beforeTokenTransfer(address(0), recipient, amount);
_totalSupply += amount;
_balances[recipient] += amount;
emit Transfer(address(0), recipient, amount);
}
| /** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a `Transfer` event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/ | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
4038,
4356
]
} | 18,197 |
Shares | ERC20.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | ERC20 | abstract contract ERC20 is IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 public override decimals;
constructor(uint8 _decimals) {
decimals = _decimals;
}... | /**
* @dev Implementation of the `IERC20` interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using `_mint`.
* For a generic mechanism see `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to... | NatSpecMultiLine | _burn | function _burn(address account, uint256 amount) internal virtual {
_beforeTokenTransfer(account, address(0), amount);
_totalSupply -= amount;
_balances[account] -= amount;
emit Transfer(account, address(0), amount);
}
| /**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a `Transfer` event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/ | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
4684,
4949
]
} | 18,198 |
Shares | ERC20.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | ERC20 | abstract contract ERC20 is IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 public override decimals;
constructor(uint8 _decimals) {
decimals = _decimals;
}... | /**
* @dev Implementation of the `IERC20` interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using `_mint`.
* For a generic mechanism see `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to... | NatSpecMultiLine | _approve | function _approve(address owner, address spender, uint256 value) internal {
_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.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
5384,
5564
]
} | 18,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.