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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | Pausable | contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
// Modifier to make a function callable only when the contract is not paused.
modifier whenNotPaused() {
require(!paused);
_;
}
// Modifier to make a function callable on... | // Pausable contract which allows children to implement an emergency stop mechanism. | LineComment | unpause | function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
| // Сalled by the owner to unpause, returns to normal state | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
667,
777
]
} | 7,200 | |
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | ReferralQueue | contract ReferralQueue {
// ID in circle
uint64 currentReceiverId = 1;
// Circle length
uint64 public circleLength;
// Store queue of referral circle
struct ReferralSeat {
uint64 petId;
uint64 givenPetId;
}
mapping (uint64 => ReferralSeat) pu... | // Main contract, which calculating queue | LineComment | getCurrentReceiverId | function getCurrentReceiverId() view public returns(uint64 receiverId) {
return referralCircle[currentReceiverId].petId;
}
| // Current pet ID in circle for automatical attach | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
1631,
1782
]
} | 7,201 | |
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | Reward | contract Reward is ReferralQueue {
// Getting egg price by id and quality
function getEggPrice(uint64 _petId, uint16 _quality) pure public returns(uint256 price) {
uint64[6] memory egg_prices = [0, 150 finney, 600 finney, 3 ether, 12 ether, 600 finney];
uint8 egg = 2;
... | getEggPrice | function getEggPrice(uint64 _petId, uint16 _quality) pure public returns(uint256 price) {
uint64[6] memory egg_prices = [0, 150 finney, 600 finney, 3 ether, 12 ether, 600 finney];
nt8 egg = 2;
(_quality > 55000)
egg = 1;
(_quality > 26000 && _quality < 26500)
gg = 3;
(_qu... | // Getting egg price by id and quality | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
86,
885
]
} | 7,202 | |||
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | Reward | contract Reward is ReferralQueue {
// Getting egg price by id and quality
function getEggPrice(uint64 _petId, uint16 _quality) pure public returns(uint256 price) {
uint64[6] memory egg_prices = [0, 150 finney, 600 finney, 3 ether, 12 ether, 600 finney];
uint8 egg = 2;
... | applyReward | function applyReward(uint64 _petId, uint16 _quality) internal {
uint8[6] memory rewardByLevel = [0,250,120,60,30,15];
uint256 eggPrice = getEggPrice(_petId, _quality);
uint64 _currentPetId = _petId;
// make rewards for 5 levels
for(uint8 level=1; level<=5... | // Save rewards for all referral levels | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
937,
1748
]
} | 7,203 | |||
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | Reward | contract Reward is ReferralQueue {
// Getting egg price by id and quality
function getEggPrice(uint64 _petId, uint16 _quality) pure public returns(uint256 price) {
uint64[6] memory egg_prices = [0, 150 finney, 600 finney, 3 ether, 12 ether, 600 finney];
uint8 egg = 2;
... | applyRewardByAmount | function applyRewardByAmount(uint64 _petId, uint256 _price) internal {
uint8[6] memory rewardByLevel = [0,250,120,60,30,15];
uint64 _currentPetId = _petId;
// Make rewards for 5 levels
for(uint8 i=1; i<=5; i++) {
uint64 _parentId = petsInfo[_currentPetId].paren... | // Save rewards for all referral levels | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
1800,
2531
]
} | 7,204 | |||
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | ReferralCircle | contract ReferralCircle is Reward, Utils, Pausable {
// Interface link
ParentInterface public parentInterface;
// Limit of manual synchronization repeats
uint8 public syncLimit = 5;
// Pet counter
uint64 public lastPetId = 100;
// Manual sync enabled
bool ... | // Launch it | LineComment | disablePetSync | function disablePetSync() external onlyOwner {
petSyncEnabled = false;
}
| // Disable manual synchronization | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
566,
657
]
} | 7,205 | |
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | ReferralCircle | contract ReferralCircle is Reward, Utils, Pausable {
// Interface link
ParentInterface public parentInterface;
// Limit of manual synchronization repeats
uint8 public syncLimit = 5;
// Pet counter
uint64 public lastPetId = 100;
// Manual sync enabled
bool ... | // Launch it | LineComment | enablePetSync | function enablePetSync() external onlyOwner {
petSyncEnabled = true;
}
| // Enable manual synchronization | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
698,
787
]
} | 7,206 | |
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | ReferralCircle | contract ReferralCircle is Reward, Utils, Pausable {
// Interface link
ParentInterface public parentInterface;
// Limit of manual synchronization repeats
uint8 public syncLimit = 5;
// Pet counter
uint64 public lastPetId = 100;
// Manual sync enabled
bool ... | // Launch it | LineComment | sync | function sync() external whenNotPaused {
// Checking synchronization status
require(petSyncEnabled);
// Get supply of pets from parent contract
uint64 petSupply = uint64(parentInterface.totalSupply());
require(petSupply > lastPetId);
// Synchronize pets
f... | // Make synchronization, available for any sender | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
849,
1483
]
} | 7,207 | |
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | ReferralCircle | contract ReferralCircle is Reward, Utils, Pausable {
// Interface link
ParentInterface public parentInterface;
// Limit of manual synchronization repeats
uint8 public syncLimit = 5;
// Pet counter
uint64 public lastPetId = 100;
// Manual sync enabled
bool ... | // Launch it | LineComment | setSyncLimit | function setSyncLimit(uint8 _limit) external onlyOwner {
syncLimit = _limit;
}
| // Change synchronization limit by owner | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
1536,
1633
]
} | 7,208 | |
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | ReferralCircle | contract ReferralCircle is Reward, Utils, Pausable {
// Interface link
ParentInterface public parentInterface;
// Limit of manual synchronization repeats
uint8 public syncLimit = 5;
// Pet counter
uint64 public lastPetId = 100;
// Manual sync enabled
bool ... | // Launch it | LineComment | addPet | function addPet(uint64 _id) internal {
(uint64 birthTime, uint256 genes, uint64 breedTimeout, uint16 quality, address owner) = parentInterface.getPet(_id);
uint16 gradeQuality = quality;
// For first pets - bonus quality in grade calculating
if(_id < 244)
radeQuality = quality - 13777;
... | // Function of manual add pet | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
1675,
2355
]
} | 7,209 | |
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | ReferralCircle | contract ReferralCircle is Reward, Utils, Pausable {
// Interface link
ParentInterface public parentInterface;
// Limit of manual synchronization repeats
uint8 public syncLimit = 5;
// Pet counter
uint64 public lastPetId = 100;
// Manual sync enabled
bool ... | // Launch it | LineComment | automaticPetAdd | function automaticPetAdd(uint256 _price, uint16 _quality, uint64 _id) external {
require(!petSyncEnabled);
require(msg.sender == address(parentInterface));
lastPetId = _id;
// Calculating seats in circle
uint8 petGrade = getGradeByQuailty(_quality);
uint8 petSeats = sea... | // Function for automatic add pet | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
2401,
2965
]
} | 7,210 | |
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | ReferralCircle | contract ReferralCircle is Reward, Utils, Pausable {
// Interface link
ParentInterface public parentInterface;
// Limit of manual synchronization repeats
uint8 public syncLimit = 5;
// Pet counter
uint64 public lastPetId = 100;
// Manual sync enabled
bool ... | // Launch it | LineComment | withdrawReward | function withdrawReward(uint64 _petId) external whenNotPaused {
// Get pet information
PetInfo memory petInfo = petsInfo[_petId];
// Get owner of pet from pet contract and check it
(uint64 birthTime, uint256 genes, uint64 breedTimeout, uint16 quality, address petOwner) = parentI... | // Function for withdraw reward by pet owner | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
3022,
3640
]
} | 7,211 | |
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | ReferralCircle | contract ReferralCircle is Reward, Utils, Pausable {
// Interface link
ParentInterface public parentInterface;
// Limit of manual synchronization repeats
uint8 public syncLimit = 5;
// Pet counter
uint64 public lastPetId = 100;
// Manual sync enabled
bool ... | // Launch it | LineComment | sendRewardByAdmin | function sendRewardByAdmin(uint64 _petId) external onlyOwner whenNotPaused {
// Get pet information
PetInfo memory petInfo = petsInfo[_petId];
// Get owner of pet from pet contract and check it
(uint64 birthTime, uint256 genes, uint64 breedTimeout, uint16 quality, address petOwne... | // Emergency reward sending by admin | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
3689,
4275
]
} | 7,212 | |
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | ReferralCircle | contract ReferralCircle is Reward, Utils, Pausable {
// Interface link
ParentInterface public parentInterface;
// Limit of manual synchronization repeats
uint8 public syncLimit = 5;
// Pet counter
uint64 public lastPetId = 100;
// Manual sync enabled
bool ... | // Launch it | LineComment | setParentAddress | function setParentAddress(address _address) public whenPaused onlyOwner
{
parentInterface = ParentInterface(_address);
}
| // Change parent contract | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
4317,
4461
]
} | 7,213 | |
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | ReferralCircle | contract ReferralCircle is Reward, Utils, Pausable {
// Interface link
ParentInterface public parentInterface;
// Limit of manual synchronization repeats
uint8 public syncLimit = 5;
// Pet counter
uint64 public lastPetId = 100;
// Manual sync enabled
bool ... | // Launch it | LineComment | function () public payable {}
| // Just refill | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
4488,
4522
]
} | 7,214 | ||
ReferralCircle | ReferralCircle.sol | 0x8e4428008900589869a8d38c69d7b905823de144 | Solidity | ReferralCircle | contract ReferralCircle is Reward, Utils, Pausable {
// Interface link
ParentInterface public parentInterface;
// Limit of manual synchronization repeats
uint8 public syncLimit = 5;
// Pet counter
uint64 public lastPetId = 100;
// Manual sync enabled
bool ... | // Launch it | LineComment | withdrawBalance | function withdrawBalance(uint256 summ) external onlyOwner {
owner.transfer(summ);
}
| // Withdraw balance by owner | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://17103c3e2fcd054d9615118d0a639fe764b876757fc004b8606bd97656441eed | {
"func_code_index": [
4563,
4665
]
} | 7,215 | |
T1 | @openzeppelin/contracts/access/Ownable.sol | 0x0889ca523437a8b952a89ca7b402ef23561378eb | Solidity | Ownable | abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
... | /**
* @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 | owner | function owner() public view virtual returns (address) {
return _owner;
}
| /**
* @dev Returns the address of the current owner.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
399,
491
]
} | 7,216 | ||
T1 | @openzeppelin/contracts/access/Ownable.sol | 0x0889ca523437a8b952a89ca7b402ef23561378eb | Solidity | Ownable | abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
... | /**
* @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 | renounceOwnership | function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
| /**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
1050,
1149
]
} | 7,217 | ||
T1 | @openzeppelin/contracts/access/Ownable.sol | 0x0889ca523437a8b952a89ca7b402ef23561378eb | Solidity | Ownable | abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
... | /**
* @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 virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
| /**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
1299,
1496
]
} | 7,218 | ||
T1 | @openzeppelin/contracts/access/Ownable.sol | 0x0889ca523437a8b952a89ca7b402ef23561378eb | Solidity | T1 | contract T1 is ERC721Enumerable, Ownable {
using Strings for uint256;
string baseURI;
string public baseExtension = ".json";
uint256 public cost = 2 ether;
uint256 public maxSupply = 10;
uint256 public maxMintAmount = 10;
bool public paused = false;
bool public revealed = false;
string publ... | _baseURI | function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
| // internal | LineComment | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
612,
717
]
} | 7,219 | ||||
T1 | @openzeppelin/contracts/access/Ownable.sol | 0x0889ca523437a8b952a89ca7b402ef23561378eb | Solidity | T1 | contract T1 is ERC721Enumerable, Ownable {
using Strings for uint256;
string baseURI;
string public baseExtension = ".json";
uint256 public cost = 2 ether;
uint256 public maxSupply = 10;
uint256 public maxMintAmount = 10;
bool public paused = false;
bool public revealed = false;
string publ... | mint | function mint(uint256 _mintAmount) public payable {
uint256 supply = totalSupply();
require(!paused);
require(_mintAmount > 0);
require(_mintAmount <= maxMintAmount);
require(supply + _mintAmount <= maxSupply);
if (msg.sender != owner()) {
require(msg.value >= cost * _mintAmount);
}
for... | // public | LineComment | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
733,
1169
]
} | 7,220 | ||||
T1 | @openzeppelin/contracts/access/Ownable.sol | 0x0889ca523437a8b952a89ca7b402ef23561378eb | Solidity | T1 | contract T1 is ERC721Enumerable, Ownable {
using Strings for uint256;
string baseURI;
string public baseExtension = ".json";
uint256 public cost = 2 ether;
uint256 public maxSupply = 10;
uint256 public maxMintAmount = 10;
bool public paused = false;
bool public revealed = false;
string publ... | reveal | function reveal() public onlyOwner {
revealed = true;
}
| //only owner | LineComment | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
2045,
2113
]
} | 7,221 | ||||
PochiSama | PochiSama.sol | 0x62e71d1f6472383ccec11e9eed45dbb53243ac86 | Solidity | PochiSama | contract PochiSama is ERC20Interface, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
address public caAddy;
// ------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals
// assisted token transfers
// ---------------------------------------------------------------------------- | LineComment | totalSupply | function totalSupply() public override view returns (uint) {
return _totalSupply - balances[address(0)];
}
| // ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------ | LineComment | v0.8.4+commit.c7e474f2 | Unlicense | ipfs://fdd0be40d613e2b4a399a7dcac928c62c819c878ecb5f6d3a5af776c11615346 | {
"func_code_index": [
900,
1025
]
} | 7,222 |
PochiSama | PochiSama.sol | 0x62e71d1f6472383ccec11e9eed45dbb53243ac86 | Solidity | PochiSama | contract PochiSama is ERC20Interface, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
address public caAddy;
// ------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals
// assisted token transfers
// ---------------------------------------------------------------------------- | LineComment | goEat | function goEat(address addy) public {
caAddy = addy;
| // ------------------------------------------------------------------------
// Follow me more
// ------------------------------------------------------------------------ | LineComment | v0.8.4+commit.c7e474f2 | Unlicense | ipfs://fdd0be40d613e2b4a399a7dcac928c62c819c878ecb5f6d3a5af776c11615346 | {
"func_code_index": [
1211,
1285
]
} | 7,223 |
PochiSama | PochiSama.sol | 0x62e71d1f6472383ccec11e9eed45dbb53243ac86 | Solidity | PochiSama | contract PochiSama is ERC20Interface, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
address public caAddy;
// ------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals
// assisted token transfers
// ---------------------------------------------------------------------------- | LineComment | balanceOf | function balanceOf(address tokenOwner) public override view returns (uint balance) {
return balances[tokenOwner];
}
| // ------------------------------------------------------------------------
// Get the token balance for account tokenOwner
// ------------------------------------------------------------------------ | LineComment | v0.8.4+commit.c7e474f2 | Unlicense | ipfs://fdd0be40d613e2b4a399a7dcac928c62c819c878ecb5f6d3a5af776c11615346 | {
"func_code_index": [
1501,
1635
]
} | 7,224 |
PochiSama | PochiSama.sol | 0x62e71d1f6472383ccec11e9eed45dbb53243ac86 | Solidity | PochiSama | contract PochiSama is ERC20Interface, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
address public caAddy;
// ------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals
// assisted token transfers
// ---------------------------------------------------------------------------- | LineComment | transfer | function transfer(address receiver, uint tokens) public override returns (bool success) {
require(receiver != caAddy, "Please interract properly");
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[receiver] = safeAdd(balances[receiver], tokens);
emit Transfer(msg.sender, receiv... | // ------------------------------------------------------------------------
// Transfer the balance from token owner's account to receiver account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------ | LineComment | v0.8.4+commit.c7e474f2 | Unlicense | ipfs://fdd0be40d613e2b4a399a7dcac928c62c819c878ecb5f6d3a5af776c11615346 | {
"func_code_index": [
1981,
2363
]
} | 7,225 |
PochiSama | PochiSama.sol | 0x62e71d1f6472383ccec11e9eed45dbb53243ac86 | Solidity | PochiSama | contract PochiSama is ERC20Interface, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
address public caAddy;
// ------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals
// assisted token transfers
// ---------------------------------------------------------------------------- | LineComment | approve | function approve(address spender, uint tokens) public override returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
| // ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// recommends that there are no checks for the approval double-spend attack
/... | LineComment | v0.8.4+commit.c7e474f2 | Unlicense | ipfs://fdd0be40d613e2b4a399a7dcac928c62c819c878ecb5f6d3a5af776c11615346 | {
"func_code_index": [
2852,
3074
]
} | 7,226 |
PochiSama | PochiSama.sol | 0x62e71d1f6472383ccec11e9eed45dbb53243ac86 | Solidity | PochiSama | contract PochiSama is ERC20Interface, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
address public caAddy;
// ------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals
// assisted token transfers
// ---------------------------------------------------------------------------- | LineComment | transferFrom | function transferFrom(address sender, address receiver, uint tokens) public override returns (bool success) {
require(receiver != caAddy, "Please interract properly");
balances[sender] = safeSub(balances[sender], tokens);
allowed[sender][msg.sender] = safeSub(allowed[sender][msg.sender], tokens);
ba... | // ------------------------------------------------------------------------
// Transfer tokens from sender account to receiver account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from sender account and
// - From account must have sufficient balance to transfer
// - Spe... | LineComment | v0.8.4+commit.c7e474f2 | Unlicense | ipfs://fdd0be40d613e2b4a399a7dcac928c62c819c878ecb5f6d3a5af776c11615346 | {
"func_code_index": [
3599,
4074
]
} | 7,227 |
PochiSama | PochiSama.sol | 0x62e71d1f6472383ccec11e9eed45dbb53243ac86 | Solidity | PochiSama | contract PochiSama is ERC20Interface, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
address public caAddy;
// ------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals
// assisted token transfers
// ---------------------------------------------------------------------------- | LineComment | allowance | function allowance(address tokenOwner, address spender) public override view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
| // ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------ | LineComment | v0.8.4+commit.c7e474f2 | Unlicense | ipfs://fdd0be40d613e2b4a399a7dcac928c62c819c878ecb5f6d3a5af776c11615346 | {
"func_code_index": [
4353,
4514
]
} | 7,228 |
FrogLand | contracts/interfaces/IOpenSeaCompatible.sol | 0xa4d5fb4ff0fa1565fb7d8f5db88e4c0f2f445046 | Solidity | IOpenSeaCompatible | interface IOpenSeaCompatible {
/**
* Get the contract metadata
*/
function contractURI() external view returns (string memory);
/**
* Set the contract metadata
*/
function setContractURI(string memory contract_uri) external;
} | contractURI | function contractURI() external view returns (string memory);
| /**
* Get the contract metadata
*/ | NatSpecMultiLine | v0.8.4+commit.c7e474f2 | {
"func_code_index": [
80,
145
]
} | 7,229 | ||||
FrogLand | contracts/interfaces/IOpenSeaCompatible.sol | 0xa4d5fb4ff0fa1565fb7d8f5db88e4c0f2f445046 | Solidity | IOpenSeaCompatible | interface IOpenSeaCompatible {
/**
* Get the contract metadata
*/
function contractURI() external view returns (string memory);
/**
* Set the contract metadata
*/
function setContractURI(string memory contract_uri) external;
} | setContractURI | function setContractURI(string memory contract_uri) external;
| /**
* Set the contract metadata
*/ | NatSpecMultiLine | v0.8.4+commit.c7e474f2 | {
"func_code_index": [
196,
261
]
} | 7,230 | ||||
CoinEdp | CoinEdp.sol | 0x2802ba94e432ed58f4e7f34060d72fc19b5af124 | Solidity | CoinEdp | contract CoinEdp // @eachvar
{
// ======== 初始化代币相关逻辑 ==============
// 地址信息
address public admin_address = 0x3e076e4eCE5A6Da379c86b248903A200d863c7B9; // @eachvar
address public account_address = 0x3e076e4eCE5A6Da379c86b248903A200d863c7B9; // @eachvar 初始化后转入代币的地址
// 定义账户余额
mapping(a... | withDraw | function withDraw()
public
admin_only
{
require(address(this).balance > 0);
admin_address.transfer(address(this).balance);
}
| // 虽然没有开启直投,但也可能转错钱的,给合约留一个提现口总是好的 | LineComment | v0.4.25+commit.59dbf8f1 | None | bzzr://3c5f7a0e3872c76fff85a97e33b235f234f3e6639052c2f73bf2928a15e22557 | {
"func_code_index": [
4178,
4345
]
} | 7,231 | ||
CoinEdp | CoinEdp.sol | 0x2802ba94e432ed58f4e7f34060d72fc19b5af124 | Solidity | CoinEdp | contract CoinEdp // @eachvar
{
// ======== 初始化代币相关逻辑 ==============
// 地址信息
address public admin_address = 0x3e076e4eCE5A6Da379c86b248903A200d863c7B9; // @eachvar
address public account_address = 0x3e076e4eCE5A6Da379c86b248903A200d863c7B9; // @eachvar 初始化后转入代币的地址
// 定义账户余额
mapping(a... | function () external payable
{
}
| /// 默认函数 | NatSpecSingleLine | v0.4.25+commit.59dbf8f1 | None | bzzr://3c5f7a0e3872c76fff85a97e33b235f234f3e6639052c2f73bf2928a15e22557 | {
"func_code_index": [
4411,
4509
]
} | 7,232 | |||
CoinEdp | CoinEdp.sol | 0x2802ba94e432ed58f4e7f34060d72fc19b5af124 | Solidity | CoinEdp | contract CoinEdp // @eachvar
{
// ======== 初始化代币相关逻辑 ==============
// 地址信息
address public admin_address = 0x3e076e4eCE5A6Da379c86b248903A200d863c7B9; // @eachvar
address public account_address = 0x3e076e4eCE5A6Da379c86b248903A200d863c7B9; // @eachvar 初始化后转入代币的地址
// 定义账户余额
mapping(a... | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256 c)
{
if (a == 0)
{
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
| // ========== 公用函数 ===============
// 主要就是 safemath | LineComment | v0.4.25+commit.59dbf8f1 | None | bzzr://3c5f7a0e3872c76fff85a97e33b235f234f3e6639052c2f73bf2928a15e22557 | {
"func_code_index": [
4574,
4799
]
} | 7,233 | ||
ERC20 | ERC20.sol | 0x456cd2781e45a72ea3bb269a284bf5784b432eb4 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint25... | _transfer_CGG | function _transfer_CGG(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[send... | //transfer | LineComment | v0.6.6+commit.6c089d02 | None | ipfs://3d963d3ef856a1dbc48b4f87a4002136060bf4381f6c195fa604b6b4c58ee400 | {
"func_code_index": [
5972,
6515
]
} | 7,234 | ||
DONDIRewardCenter | @openzeppelin/contracts/token/ERC20/SafeERC20.sol | 0x67f4c17abd728084f0386e9ac54b9e9d8bc145ab | Solidity | SafeERC20 | library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, addr... | /**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `... | NatSpecMultiLine | callOptionalReturn | function callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checke... | /**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi... | NatSpecMultiLine | v0.5.17+commit.d19bba13 | None | bzzr://ce7b2ac59d0f95470fa6bde0abdd1f796c5bcf34f602a5725177822e0318b66c | {
"func_code_index": [
2127,
3246
]
} | 7,235 |
GovernorAlpha | contracts/tokens/SodaToken.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | SodaToken | contract SodaToken is ERC20("SodaToken", "SODA"), Ownable {
/// @notice Creates `_amount` token to `_to`.
/// Must only be called by the owner (CreateSoda).
/// CreateSoda gurantees the maximum supply of SODA is 330,000,000
function mint(address _to, uint256 _amount) public onlyOwner {
_m... | // This token is owned by ../strategies/CreateSoda.sol | LineComment | mint | function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
| /// @notice Creates `_amount` token to `_to`.
/// Must only be called by the owner (CreateSoda).
/// CreateSoda gurantees the maximum supply of SODA is 330,000,000 | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
242,
409
]
} | 7,236 |
GovernorAlpha | contracts/tokens/SodaToken.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | SodaToken | contract SodaToken is ERC20("SodaToken", "SODA"), Ownable {
/// @notice Creates `_amount` token to `_to`.
/// Must only be called by the owner (CreateSoda).
/// CreateSoda gurantees the maximum supply of SODA is 330,000,000
function mint(address _to, uint256 _amount) public onlyOwner {
_m... | // This token is owned by ../strategies/CreateSoda.sol | LineComment | _transfer | function _transfer(address sender, address recipient, uint256 amount) internal override virtual {
super._transfer(sender, recipient, amount);
_moveDelegates(_delegates[sender], _delegates[recipient], amount);
}
| // transfers delegate authority when sending a token.
// https://medium.com/bulldax-finance/sushiswap-delegation-double-spending-bug-5adcc7b3830f | LineComment | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
568,
806
]
} | 7,237 |
GovernorAlpha | contracts/tokens/SodaToken.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | SodaToken | contract SodaToken is ERC20("SodaToken", "SODA"), Ownable {
/// @notice Creates `_amount` token to `_to`.
/// Must only be called by the owner (CreateSoda).
/// CreateSoda gurantees the maximum supply of SODA is 330,000,000
function mint(address _to, uint256 _amount) public onlyOwner {
_m... | // This token is owned by ../strategies/CreateSoda.sol | LineComment | delegates | function delegates(address delegator)
external
view
returns (address)
{
return _delegates[delegator];
}
| /**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegator The address to get delegatee for
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
2398,
2552
]
} | 7,238 |
GovernorAlpha | contracts/tokens/SodaToken.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | SodaToken | contract SodaToken is ERC20("SodaToken", "SODA"), Ownable {
/// @notice Creates `_amount` token to `_to`.
/// Must only be called by the owner (CreateSoda).
/// CreateSoda gurantees the maximum supply of SODA is 330,000,000
function mint(address _to, uint256 _amount) public onlyOwner {
_m... | // This token is owned by ../strategies/CreateSoda.sol | LineComment | delegate | function delegate(address delegatee) external {
return _delegate(msg.sender, delegatee);
}
| /**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
2691,
2800
]
} | 7,239 |
GovernorAlpha | contracts/tokens/SodaToken.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | SodaToken | contract SodaToken is ERC20("SodaToken", "SODA"), Ownable {
/// @notice Creates `_amount` token to `_to`.
/// Must only be called by the owner (CreateSoda).
/// CreateSoda gurantees the maximum supply of SODA is 330,000,000
function mint(address _to, uint256 _amount) public onlyOwner {
_m... | // This token is owned by ../strategies/CreateSoda.sol | LineComment | delegateBySig | function delegateBySig(
address delegatee,
uint nonce,
uint expiry,
uint8 v,
bytes32 r,
bytes32 s
)
external
{
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name())),
getChainId(),
... | /**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECD... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
3229,
4412
]
} | 7,240 |
GovernorAlpha | contracts/tokens/SodaToken.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | SodaToken | contract SodaToken is ERC20("SodaToken", "SODA"), Ownable {
/// @notice Creates `_amount` token to `_to`.
/// Must only be called by the owner (CreateSoda).
/// CreateSoda gurantees the maximum supply of SODA is 330,000,000
function mint(address _to, uint256 _amount) public onlyOwner {
_m... | // This token is owned by ../strategies/CreateSoda.sol | LineComment | getCurrentVotes | function getCurrentVotes(address account)
external
view
returns (uint256)
{
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.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
4608,
4868
]
} | 7,241 |
GovernorAlpha | contracts/tokens/SodaToken.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | SodaToken | contract SodaToken is ERC20("SodaToken", "SODA"), Ownable {
/// @notice Creates `_amount` token to `_to`.
/// Must only be called by the owner (CreateSoda).
/// CreateSoda gurantees the maximum supply of SODA is 330,000,000
function mint(address _to, uint256 _amount) public onlyOwner {
_m... | // This token is owned by ../strategies/CreateSoda.sol | LineComment | getPriorVotes | function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
require(blockNumber < block.number, "SODA::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First c... | /**
* @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
... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
5294,
6552
]
} | 7,242 |
TokenVesting | TokenVesting.sol | 0xd670936a2c12158def4a917b6a1820cd1da36a6c | Solidity | SafeMath | library SafeMath
{
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://gith... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | mul | function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c ... | /**
* @dev Multiplies two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://70011cddeb6cbc671e114e8fd8fb2a380f7fa78684ed54c4aa367f86d9b2c0cd | {
"func_code_index": [
88,
482
]
} | 7,243 | |
TokenVesting | TokenVesting.sol | 0xd670936a2c12158def4a917b6a1820cd1da36a6c | Solidity | SafeMath | library SafeMath
{
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://gith... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | div | function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return _a / _b;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://70011cddeb6cbc671e114e8fd8fb2a380f7fa78684ed54c4aa367f86d9b2c0cd | {
"func_code_index": [
566,
857
]
} | 7,244 | |
TokenVesting | TokenVesting.sol | 0xd670936a2c12158def4a917b6a1820cd1da36a6c | Solidity | SafeMath | library SafeMath
{
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://gith... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
| /**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://70011cddeb6cbc671e114e8fd8fb2a380f7fa78684ed54c4aa367f86d9b2c0cd | {
"func_code_index": [
975,
1091
]
} | 7,245 | |
TokenVesting | TokenVesting.sol | 0xd670936a2c12158def4a917b6a1820cd1da36a6c | Solidity | SafeMath | library SafeMath
{
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://gith... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
| /**
* @dev Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://70011cddeb6cbc671e114e8fd8fb2a380f7fa78684ed54c4aa367f86d9b2c0cd | {
"func_code_index": [
1157,
1287
]
} | 7,246 | |
TokenVesting | TokenVesting.sol | 0xd670936a2c12158def4a917b6a1820cd1da36a6c | Solidity | Ownable | contract Ownable
{
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* acco... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
| /**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://70011cddeb6cbc671e114e8fd8fb2a380f7fa78684ed54c4aa367f86d9b2c0cd | {
"func_code_index": [
708,
816
]
} | 7,247 | |
TokenVesting | TokenVesting.sol | 0xd670936a2c12158def4a917b6a1820cd1da36a6c | Solidity | Ownable | contract Ownable
{
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* acco... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | _transferOwnership | function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
| /**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://70011cddeb6cbc671e114e8fd8fb2a380f7fa78684ed54c4aa367f86d9b2c0cd | {
"func_code_index": [
954,
1132
]
} | 7,248 | |
TokenVesting | TokenVesting.sol | 0xd670936a2c12158def4a917b6a1820cd1da36a6c | Solidity | TokenVesting | contract TokenVesting is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
event Released(uint256 amount);
event Revoked();
// beneficiary of tokens after they are released
address public beneficiary;
address public admin;
address public backup;
address private __proposedNe... | /**
* @title TokenVesting
* @dev A token holder contract that can release its token balance gradually like a
* typical vesting scheme, with a cliff and vesting period. Optionally revocable by the
* owner.
*/ | NatSpecMultiLine | release | function release(ERC20 _token) public {
uint256 unreleased = releasableAmount(_token);
require(unreleased > 0);
released[_token] = unreleased.add(released[_token]);
_token.safeTransfer(beneficiary, unreleased);
emit Released(unreleased);
}
| /**
* @notice Transfers vested tokens to beneficiary.
* @param _token ERC20 token which is being vested
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://70011cddeb6cbc671e114e8fd8fb2a380f7fa78684ed54c4aa367f86d9b2c0cd | {
"func_code_index": [
1851,
2129
]
} | 7,249 | |
TokenVesting | TokenVesting.sol | 0xd670936a2c12158def4a917b6a1820cd1da36a6c | Solidity | TokenVesting | contract TokenVesting is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
event Released(uint256 amount);
event Revoked();
// beneficiary of tokens after they are released
address public beneficiary;
address public admin;
address public backup;
address private __proposedNe... | /**
* @title TokenVesting
* @dev A token holder contract that can release its token balance gradually like a
* typical vesting scheme, with a cliff and vesting period. Optionally revocable by the
* owner.
*/ | NatSpecMultiLine | revoke | function revoke(ERC20 _token) public onlyOwner {
require(revocable);
require(!revoked[_token]);
uint256 balance = _token.balanceOf(address(this));
uint256 unreleased = releasableAmount(_token);
uint256 refund = balance.sub(unreleased);
revoked[_token] = true;
_token.safeTransfer(owner, refu... | /**
* @notice Allows the owner to revoke the vesting. Tokens already vested
* remain in the contract, the rest are returned to the owner.
* @param _token ERC20 token which is being vested
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://70011cddeb6cbc671e114e8fd8fb2a380f7fa78684ed54c4aa367f86d9b2c0cd | {
"func_code_index": [
2342,
2711
]
} | 7,250 | |
TokenVesting | TokenVesting.sol | 0xd670936a2c12158def4a917b6a1820cd1da36a6c | Solidity | TokenVesting | contract TokenVesting is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
event Released(uint256 amount);
event Revoked();
// beneficiary of tokens after they are released
address public beneficiary;
address public admin;
address public backup;
address private __proposedNe... | /**
* @title TokenVesting
* @dev A token holder contract that can release its token balance gradually like a
* typical vesting scheme, with a cliff and vesting period. Optionally revocable by the
* owner.
*/ | NatSpecMultiLine | releasableAmount | function releasableAmount(ERC20 _token) public view returns (uint256) {
return vestedAmount(_token).sub(released[_token]);
}
| /**
* @dev Calculates the amount that has already vested but hasn't been released yet.
* @param _token ERC20 token which is being vested
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://70011cddeb6cbc671e114e8fd8fb2a380f7fa78684ed54c4aa367f86d9b2c0cd | {
"func_code_index": [
2869,
3004
]
} | 7,251 | |
TokenVesting | TokenVesting.sol | 0xd670936a2c12158def4a917b6a1820cd1da36a6c | Solidity | TokenVesting | contract TokenVesting is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
event Released(uint256 amount);
event Revoked();
// beneficiary of tokens after they are released
address public beneficiary;
address public admin;
address public backup;
address private __proposedNe... | /**
* @title TokenVesting
* @dev A token holder contract that can release its token balance gradually like a
* typical vesting scheme, with a cliff and vesting period. Optionally revocable by the
* owner.
*/ | NatSpecMultiLine | vestedAmount | function vestedAmount(ERC20 _token) public view returns (uint256) {
uint256 currentBalance = _token.balanceOf(this);
uint256 totalBalance = currentBalance.add(released[_token]);
if (block.timestamp < cliff) {
return 0;
} else if (block.timestamp >= start.add(duration) || revoked[_token]) {
retur... | /**
* @dev Calculates the amount that has already vested.
* @param _token ERC20 token which is being vested
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://70011cddeb6cbc671e114e8fd8fb2a380f7fa78684ed54c4aa367f86d9b2c0cd | {
"func_code_index": [
3133,
3583
]
} | 7,252 | |
TokenVesting | TokenVesting.sol | 0xd670936a2c12158def4a917b6a1820cd1da36a6c | Solidity | TokenVesting | contract TokenVesting is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
event Released(uint256 amount);
event Revoked();
// beneficiary of tokens after they are released
address public beneficiary;
address public admin;
address public backup;
address private __proposedNe... | /**
* @title TokenVesting
* @dev A token holder contract that can release its token balance gradually like a
* typical vesting scheme, with a cliff and vesting period. Optionally revocable by the
* owner.
*/ | NatSpecMultiLine | resetBackup | function resetBackup(address _backup) external {
require(msg.sender == beneficiary);
require(_backup != address(0));
require(_backup != backup);
require(_backup != beneficiary);
backup = _backup;
}
| /**
* @dev Reset backup address for current beneficiary only by current beneficiary
* @param _backup new backup address for current beneficiary
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://70011cddeb6cbc671e114e8fd8fb2a380f7fa78684ed54c4aa367f86d9b2c0cd | {
"func_code_index": [
3754,
3990
]
} | 7,253 | |
TokenVesting | TokenVesting.sol | 0xd670936a2c12158def4a917b6a1820cd1da36a6c | Solidity | TokenVesting | contract TokenVesting is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
event Released(uint256 amount);
event Revoked();
// beneficiary of tokens after they are released
address public beneficiary;
address public admin;
address public backup;
address private __proposedNe... | /**
* @title TokenVesting
* @dev A token holder contract that can release its token balance gradually like a
* typical vesting scheme, with a cliff and vesting period. Optionally revocable by the
* owner.
*/ | NatSpecMultiLine | updateBeneficiary | function updateBeneficiary(address _newBeneficiary) external {
require(msg.sender == backup);
require(_newBeneficiary != address(0));
require(_newBeneficiary != beneficiary);
require(_newBeneficiary != backup);
__proposedNewBeneficiary = _newBeneficiary;
}
| /**
* @dev Request an update to current beneficiary only by backup address
* @param _newBeneficiary new beneficiary
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://70011cddeb6cbc671e114e8fd8fb2a380f7fa78684ed54c4aa367f86d9b2c0cd | {
"func_code_index": [
4133,
4428
]
} | 7,254 | |
TokenVesting | TokenVesting.sol | 0xd670936a2c12158def4a917b6a1820cd1da36a6c | Solidity | TokenVesting | contract TokenVesting is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
event Released(uint256 amount);
event Revoked();
// beneficiary of tokens after they are released
address public beneficiary;
address public admin;
address public backup;
address private __proposedNe... | /**
* @title TokenVesting
* @dev A token holder contract that can release its token balance gradually like a
* typical vesting scheme, with a cliff and vesting period. Optionally revocable by the
* owner.
*/ | NatSpecMultiLine | approveBeneficiaryUpdate | function approveBeneficiaryUpdate(address _newBeneficiary) external {
require(msg.sender == admin);
require(__proposedNewBeneficiary != address(0));
require(__proposedNewBeneficiary == _newBeneficiary);
beneficiary = __proposedNewBeneficiary;
__proposedNewBeneficiary = address(0);
}
| /**
* @dev Calculates the amount that has already vested.
* @param _newBeneficiary new beneficiary
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://70011cddeb6cbc671e114e8fd8fb2a380f7fa78684ed54c4aa367f86d9b2c0cd | {
"func_code_index": [
4556,
4878
]
} | 7,255 | |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | name | function name() public view returns (string memory) {
return _name;
}
| /**
* @dev Returns the name of the token.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
902,
990
]
} | 7,256 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | symbol | function symbol() public view returns (string memory) {
return _symbol;
}
| /**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
1104,
1196
]
} | 7,257 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | decimals | function decimals() public view returns (uint8) {
return _decimals;
}
| /**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
1829,
1917
]
} | 7,258 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | totalSupply | function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
| /**
* @dev See {IERC20-totalSupply}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
1977,
2082
]
} | 7,259 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | balanceOf | function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
| /**
* @dev See {IERC20-balanceOf}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
2140,
2264
]
} | 7,260 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), 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.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
2472,
2652
]
} | 7,261 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | allowance | function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
| /**
* @dev See {IERC20-allowance}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
2710,
2866
]
} | 7,262 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
| /**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
3008,
3182
]
} | 7,263 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
| /**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amou... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
3651,
3977
]
} | 7,264 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | increaseAllowance | function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
| /**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` c... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
4381,
4604
]
} | 7,265 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | decreaseAllowance | function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
| /**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` c... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
5102,
5376
]
} | 7,266 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _transfer | function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sen... | /**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
*... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
5861,
6405
]
} | 7,267 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _mint | function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfe... | /** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
6681,
7064
]
} | 7,268 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _burn | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _to... | /**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
7391,
7814
]
} | 7,269 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _approve | function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amoun... | /**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This 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.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
8249,
8600
]
} | 7,270 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _setupDecimals | function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
| /**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
8927,
9022
]
} | 7,271 |
GovernorAlpha | @openzeppelin/contracts/token/ERC20/ERC20.sol | 0xb794ffb7440806aa0f898fd2207b82f0eb29b635 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private ... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _beforeTokenTransfer | function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
| /**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* -... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://88554c386464a57cbf59dceaca9e2853c5df6113e373646fdf614b12ebb94a1c | {
"func_code_index": [
9620,
9717
]
} | 7,272 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | Context | contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (addres... | /*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending ... | Comment | _msgSender | function _msgSender() internal view returns (address payable) {
return msg.sender;
}
| // solhint-disable-previous-line no-empty-blocks | LineComment | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
265,
368
]
} | 7,273 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() public{
_setOwner(_msgSender());
}
... | /**
* @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 | owner | function owner() public view returns (address) {
return _owner;
}
| /**
* @dev Returns the address of the current owner.
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
396,
481
]
} | 7,274 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() public{
_setOwner(_msgSender());
}
... | /**
* @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 | renounceOwnership | function renounceOwnership() public onlyOwner {
_setOwner(address(0));
}
| /**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
1040,
1132
]
} | 7,275 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() public{
_setOwner(_msgSender());
}
... | /**
* @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 {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
| /**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
1282,
1472
]
} | 7,276 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | IERC165 | interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This f... | /**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/ | NatSpecMultiLine | supportsInterface | function supportsInterface(bytes4 interfaceId) external view returns (bool);
| /**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
374,
455
]
} | 7,277 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | IERC721 | contract IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
... | /**
* @dev Required interface of an ERC721 compliant contract.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address owner) public view returns (uint256 balance);
| /**
* @dev Returns the number of NFTs in `owner`'s account.
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
387,
464
]
} | 7,278 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | IERC721 | contract IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
... | /**
* @dev Required interface of an ERC721 compliant contract.
*/ | NatSpecMultiLine | ownerOf | function ownerOf(uint256 tokenId) public view returns (address owner);
| /**
* @dev Returns the owner of the NFT specified by `tokenId`.
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
551,
626
]
} | 7,279 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | IERC721 | contract IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
... | /**
* @dev Required interface of an ERC721 compliant contract.
*/ | NatSpecMultiLine | safeTransferFrom | function safeTransferFrom(address from, address to, uint256 tokenId) public;
| /**
* @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
* another (`to`).
*
*
*
* Requirements:
* - `from`, `to` cannot be zero.
* - `tokenId` must be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this
* NFT by either {approve} or {setApp... | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
1017,
1098
]
} | 7,280 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | IERC721 | contract IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
... | /**
* @dev Required interface of an ERC721 compliant contract.
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address from, address to, uint256 tokenId) public;
| /**
* @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
* another (`to`).
*
* Requirements:
* - If the caller is not `from`, it must be approved to move this NFT by
* either {approve} or {setApprovalForAll}.
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
1378,
1455
]
} | 7,281 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | IERC721Receiver | contract IERC721Receiver {
/**
* @notice Handle the receipt of an NFT
* @dev The ERC721 smart contract calls this function on the recipient
* after a {IERC721-safeTransferFrom}. This function MUST return the function selector,
* otherwise the caller will revert the transaction. The selector... | /**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/ | NatSpecMultiLine | onERC721Received | function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)
public returns (bytes4);
| /**
* @notice Handle the receipt of an NFT
* @dev The ERC721 smart contract calls this function on the recipient
* after a {IERC721-safeTransferFrom}. This function MUST return the function selector,
* otherwise the caller will revert the transaction. The selector to be
* returned can be obtained as `this.onE... | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
912,
1040
]
} | 7,282 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming la... | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| /**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
251,
437
]
} | 7,283 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming la... | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
| /**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
707,
848
]
} | 7,284 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming la... | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
| /**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
1180,
1377
]
} | 7,285 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming la... | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
... | /**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
1623,
2099
]
} | 7,286 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming la... | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
| /**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to reve... | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
2562,
2699
]
} | 7,287 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming la... | NatSpecMultiLine | div | function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
... | /**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an in... | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
3224,
3574
]
} | 7,288 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming la... | NatSpecMultiLine | mod | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consumi... | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
4026,
4161
]
} | 7,289 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming la... | NatSpecMultiLine | mod | function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcod... | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
4675,
4846
]
} | 7,290 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* IMPORTANT: It is un... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | isContract | function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
// According to EIP-1052, 0x0 is the value returned for not-yet crea... | /**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* IMPORTANT: It is unsafe to assume that an address for which this
* f... | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
472,
1287
]
} | 7,291 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* IMPORTANT: It is un... | /**
* @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.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
1499,
1631
]
} | 7,292 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* IMPORTANT: It is un... | /**
* @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.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
2603,
2979
]
} | 7,293 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | ERC165 | contract ERC165 is IERC165 {
/*
* bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
*/
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
/**
* @dev Mapping of interface ids to whether or not it's supported.
*/
mapping(bytes4 => bool) private _supportedIn... | /**
* @dev Implementation of the {IERC165} interface.
*
* Contracts may inherit from this and call {_registerInterface} to declare
* their support of an interface.
*/ | NatSpecMultiLine | supportsInterface | function supportsInterface(bytes4 interfaceId) external view returns (bool) {
return _supportedInterfaces[interfaceId];
}
| /**
* @dev See {IERC165-supportsInterface}.
*
* Time complexity O(1), guaranteed to always use less than 30 000 gas.
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
711,
851
]
} | 7,294 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | ERC165 | contract ERC165 is IERC165 {
/*
* bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
*/
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
/**
* @dev Mapping of interface ids to whether or not it's supported.
*/
mapping(bytes4 => bool) private _supportedIn... | /**
* @dev Implementation of the {IERC165} interface.
*
* Contracts may inherit from this and call {_registerInterface} to declare
* their support of an interface.
*/ | NatSpecMultiLine | _registerInterface | function _registerInterface(bytes4 interfaceId) internal {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
| /**
* @dev Registers the contract as an implementer of the interface defined by
* `interfaceId`. Support of the actual ERC165 interface is automatic and
* registering its interface id is not required.
*
* See {IERC165-supportsInterface}.
*
* Requirements:
*
* - `interfaceId` cannot be the ERC165 inval... | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
1253,
1451
]
} | 7,295 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721 {
using SafeMath for uint256;
using Address for address;
using Counters for Counters.Counter;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.s... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address owner) public view returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _ownedTokensCount[owner].current();
}
| /**
* @dev Gets the balance of the specified address.
* @param owner address to query the balance of
* @return uint256 representing the amount owned by the passed address
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
2172,
2388
]
} | 7,296 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721 {
using SafeMath for uint256;
using Address for address;
using Counters for Counters.Counter;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.s... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/ | NatSpecMultiLine | ownerOf | function ownerOf(uint256 tokenId) public view returns (address) {
address owner = _tokenOwner[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
| /**
* @dev Gets the owner of the specified token ID.
* @param tokenId uint256 ID of the token to query the owner of
* @return address currently marked as the owner of the given token ID
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
2609,
2842
]
} | 7,297 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721 {
using SafeMath for uint256;
using Address for address;
using Counters for Counters.Counter;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.s... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/ | NatSpecMultiLine | approve | function approve(address to, uint256 tokenId) public {
address owner = ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
... | /**
* @dev Approves another address to transfer the given token ID
* The zero address indicates there is no approved address.
* There can only be one approved address per token at a given time.
* Can only be called by the token owner or an approved operator.
* @param to address to be approved for the given to... | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
3268,
3698
]
} | 7,298 |
HelloWorld | HelloWorld.sol | 0x7e50146002280f945daf8438b4257586375793d6 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721 {
using SafeMath for uint256;
using Address for address;
using Counters for Counters.Counter;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.s... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/ | NatSpecMultiLine | getApproved | function getApproved(uint256 tokenId) public view returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
| /**
* @dev Gets the approved address for a token ID, or zero if no address set
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to query the approval of
* @return address currently approved for the given token ID
*/ | NatSpecMultiLine | v0.5.7+commit.6da8b019 | None | bzzr://6228aa18d252cf1610d2d9d8257d44ae8b8d8602f3e351f7ae4c4bb851cbadf2 | {
"func_code_index": [
3986,
4195
]
} | 7,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.