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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Vesting | contracts/Vesting.sol | 0x3758db4bdda0b770666c849d9a251df1c24f263f | Solidity | Vesting | contract Vesting is Ownable {
// The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is
// therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore,
// it is recommended to avoid using short time durat... | /**
* @title Vesting
* @dev Token vesting contract for investors
*/ | NatSpecMultiLine | revoke | function revoke(address _revoke) public onlyOwner {
require(revocable, "Vesting: cannot revoke");
require(!revoked[_revoke], "Vesting: token already revoked");
uint256 balance = allocation(_revoke);
require(balance > 0, "Vesting: no allocation");
uint256 unreleased = _releasableAmount(_revoke);
... | /**
* @notice Allows the owner to revoke the vesting. Tokens already vested
* remain in the contract, the rest are returned to the owner.
* @param _revoke address which is being vested
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | MIT | {
"func_code_index": [
4254,
4822
]
} | 17,800 | |
Vesting | contracts/Vesting.sol | 0x3758db4bdda0b770666c849d9a251df1c24f263f | Solidity | Vesting | contract Vesting is Ownable {
// The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is
// therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore,
// it is recommended to avoid using short time durat... | /**
* @title Vesting
* @dev Token vesting contract for investors
*/ | NatSpecMultiLine | _releasableAmount | function _releasableAmount(address investor) private view returns (uint256) {
return _vestedAmount(investor).add(initialRelease(investor)).sub(released(investor));
}
| /**
* @dev Calculates the amount that has already vested but hasn't been released yet.
* @param investor address which is being vested
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | MIT | {
"func_code_index": [
4981,
5162
]
} | 17,801 | |
Vesting | contracts/Vesting.sol | 0x3758db4bdda0b770666c849d9a251df1c24f263f | Solidity | Vesting | contract Vesting is Ownable {
// The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is
// therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore,
// it is recommended to avoid using short time durat... | /**
* @title Vesting
* @dev Token vesting contract for investors
*/ | NatSpecMultiLine | _vestedAmount | function _vestedAmount(address investor) private view returns (uint256) {
uint256 totalBalance = allocation(investor).sub(initialRelease(investor));
if (block.timestamp >= start(investor).add(duration(investor)) || revoked[investor]) {
return totalBalance;
} else {
return totalBalance.mul(b... | /**
* @dev Calculates the amount that has already vested.
* @param investor address which is being vested
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | MIT | {
"func_code_index": [
5292,
5713
]
} | 17,802 | |
MetaHouseMafia | /contracts/MetaHouseMafia.sol | 0x36e1c606fca18cb7f53856f487e5543db05057db | Solidity | OpenSeaGasFreeListing | library OpenSeaGasFreeListing {
/**
@notice Returns whether the operator is an OpenSea proxy for the owner, thus
allowing it to list without the token owner paying gas.
@dev ERC{721,1155}.isApprovedForAll should be overriden to also check if
this function returns true.
*/
function isApprove... | isApprovedForAll | function isApprovedForAll(address owner, address operator)
internal
view
returns (bool)
{
ProxyRegistry registry;
assembly {
switch chainid()
case 1 {
// mainnet
registry := 0xa5409ec958c83c3f309868babaca7c86dcb077c1
}
case 4 {
// r... | /**
@notice Returns whether the operator is an OpenSea proxy for the owner, thus
allowing it to list without the token owner paying gas.
@dev ERC{721,1155}.isApprovedForAll should be overriden to also check if
this function returns true.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
298,
902
]
} | 17,803 | ||||
Reforestation | contracts/Reforestation.sol | 0x4ad2d817b60db6ee79c1ae016429251a0d25423f | Solidity | Reforestation | contract Reforestation is ERC721, Ownable, ChainlinkClient {
using Counters for Counters.Counter;
// Pausable.
bool private _paused;
// Represents a minting user, for lookup from Chainlink fulfill.
struct User {
uint256 tokenId;
address addr;
}
// Generative
uint16 constant private generative... | withdraw | function withdraw() external onlyOwner {
address payable payableOwner = payable(owner());
payableOwner.transfer(address(this).balance);
}
| /**
* Payout
*/ | NatSpecMultiLine | v0.6.6+commit.6c089d02 | {
"func_code_index": [
1739,
1888
]
} | 17,804 | ||||
Reforestation | contracts/Reforestation.sol | 0x4ad2d817b60db6ee79c1ae016429251a0d25423f | Solidity | Reforestation | contract Reforestation is ERC721, Ownable, ChainlinkClient {
using Counters for Counters.Counter;
// Pausable.
bool private _paused;
// Represents a minting user, for lookup from Chainlink fulfill.
struct User {
uint256 tokenId;
address addr;
}
// Generative
uint16 constant private generative... | paused | function paused() external view returns (bool) {
return _paused;
}
| /**
* Pausing
*/ | NatSpecMultiLine | v0.6.6+commit.6c089d02 | {
"func_code_index": [
2161,
2235
]
} | 17,805 | ||||
Reforestation | contracts/Reforestation.sol | 0x4ad2d817b60db6ee79c1ae016429251a0d25423f | Solidity | Reforestation | contract Reforestation is ERC721, Ownable, ChainlinkClient {
using Counters for Counters.Counter;
// Pausable.
bool private _paused;
// Represents a minting user, for lookup from Chainlink fulfill.
struct User {
uint256 tokenId;
address addr;
}
// Generative
uint16 constant private generative... | getOracle | function getOracle() external view returns (address, bytes32, uint256) {
return (oracle, jobId, fee);
}
| /**
* Updating Oracle
*/ | NatSpecMultiLine | v0.6.6+commit.6c089d02 | {
"func_code_index": [
2348,
2459
]
} | 17,806 | ||||
Reforestation | contracts/Reforestation.sol | 0x4ad2d817b60db6ee79c1ae016429251a0d25423f | Solidity | Reforestation | contract Reforestation is ERC721, Ownable, ChainlinkClient {
using Counters for Counters.Counter;
// Pausable.
bool private _paused;
// Represents a minting user, for lookup from Chainlink fulfill.
struct User {
uint256 tokenId;
address addr;
}
// Generative
uint16 constant private generative... | getGenerativeMinted | function getGenerativeMinted() external view returns (uint256) {
return generativeMinted.current();
}
| /**
* Methods for Web3
*/ | NatSpecMultiLine | v0.6.6+commit.6c089d02 | {
"func_code_index": [
2652,
2761
]
} | 17,807 | ||||
Reforestation | contracts/Reforestation.sol | 0x4ad2d817b60db6ee79c1ae016429251a0d25423f | Solidity | Reforestation | contract Reforestation is ERC721, Ownable, ChainlinkClient {
using Counters for Counters.Counter;
// Pausable.
bool private _paused;
// Represents a minting user, for lookup from Chainlink fulfill.
struct User {
uint256 tokenId;
address addr;
}
// Generative
uint16 constant private generative... | mintTrunk | function mintTrunk(uint256 randomSeed) external payable returns (uint256 tokenId) {
// Enforce tiered fees.
require(msg.value >= getBaseFeeTier());
require(msg.value >= getFeeTier());
// Pausing mints.
require(!_paused);
// Update minted count.
mintedCount[msg.sender] = (mintedCount[msg.sender] + 1);
... | /**
* Generative minting
*/ | NatSpecMultiLine | v0.6.6+commit.6c089d02 | {
"func_code_index": [
2801,
3664
]
} | 17,808 | ||||
Reforestation | contracts/Reforestation.sol | 0x4ad2d817b60db6ee79c1ae016429251a0d25423f | Solidity | Reforestation | contract Reforestation is ERC721, Ownable, ChainlinkClient {
using Counters for Counters.Counter;
// Pausable.
bool private _paused;
// Represents a minting user, for lookup from Chainlink fulfill.
struct User {
uint256 tokenId;
address addr;
}
// Generative
uint16 constant private generative... | setBaseURI | function setBaseURI(string calldata baseURI_) external onlyOwner {
// Allows us to update the baseURI after deploy, so we can move to IPFS if we choose to.
_setBaseURI(baseURI_);
}
| // Updates | LineComment | v0.6.6+commit.6c089d02 | {
"func_code_index": [
4600,
4792
]
} | 17,809 | ||||
Reforestation | contracts/Reforestation.sol | 0x4ad2d817b60db6ee79c1ae016429251a0d25423f | Solidity | Reforestation | contract Reforestation is ERC721, Ownable, ChainlinkClient {
using Counters for Counters.Counter;
// Pausable.
bool private _paused;
// Represents a minting user, for lookup from Chainlink fulfill.
struct User {
uint256 tokenId;
address addr;
}
// Generative
uint16 constant private generative... | remoteMint | function remoteMint(uint256 randomSeed, uint256 tokenId) private returns (bytes32 requestId) {
// Make the Chainlink request.
Chainlink.Request memory request = buildChainlinkRequest(jobId, address(this), this.fulfill.selector);
string memory url = string(
abi.encodePacked(
"https://service.cryptotrunks... | // Regular | LineComment | v0.6.6+commit.6c089d02 | {
"func_code_index": [
4843,
5494
]
} | 17,810 | ||||
Reforestation | contracts/Reforestation.sol | 0x4ad2d817b60db6ee79c1ae016429251a0d25423f | Solidity | Reforestation | contract Reforestation is ERC721, Ownable, ChainlinkClient {
using Counters for Counters.Counter;
// Pausable.
bool private _paused;
// Represents a minting user, for lookup from Chainlink fulfill.
struct User {
uint256 tokenId;
address addr;
}
// Generative
uint16 constant private generative... | toString | function toString(address account) private pure returns (string memory) {
return toString(abi.encodePacked(account));
}
| /**
* Utils
*/ | NatSpecMultiLine | v0.6.6+commit.6c089d02 | {
"func_code_index": [
6593,
6720
]
} | 17,811 | ||||
Reforestation | contracts/Reforestation.sol | 0x4ad2d817b60db6ee79c1ae016429251a0d25423f | Solidity | Reforestation | contract Reforestation is ERC721, Ownable, ChainlinkClient {
using Counters for Counters.Counter;
// Pausable.
bool private _paused;
// Represents a minting user, for lookup from Chainlink fulfill.
struct User {
uint256 tokenId;
address addr;
}
// Generative
uint16 constant private generative... | toString | function toString(bytes memory data) private pure returns (string memory) {
bytes memory alphabet = "0123456789abcdef";
bytes memory str = new bytes(2 + data.length * 2);
str[0] = "0";
str[1] = "x";
for (uint i = 0; i < data.length; i++) {
str[2+i*2] = alphabet[uint(uint8(data[i] >> 4))];
str[3+i*... | // https://ethereum.stackexchange.com/a/58341/68257 | LineComment | v0.6.6+commit.6c089d02 | {
"func_code_index": [
6776,
7189
]
} | 17,812 | ||||
NFT | contracts/openzeppelin/IERC2981.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | IERC2981 | interface IERC2981 is IERC165 {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be payed in that same unit of exchange.
*/
function royaltyInfo(uint256 tokenId, uint256 s... | /**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*
* _Available since v4.5._
*/ | NatSpecMultiLine | royaltyInfo | function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
| /**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be payed in that same unit of exchange.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
269,
418
]
} | 17,813 | ||
NFT | contracts/openzeppelin/ERC2981.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC2981 | abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function... | /**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the f... | NatSpecMultiLine | supportsInterface | function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
| /**
* @dev See {IERC165-supportsInterface}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
308,
525
]
} | 17,814 | ||
NFT | contracts/openzeppelin/ERC2981.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC2981 | abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function... | /**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the f... | NatSpecMultiLine | royaltyInfo | function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view override returns (address, uint256) {
RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];
if (royalty.receiver == address(0)) {
royalty = _defaultRoyaltyInfo;
}
uint256 royaltyAmount = (_salePrice * royalty.royaltyF... | /**
* @inheritdoc IERC2981
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
571,
1001
]
} | 17,815 | ||
NFT | contracts/openzeppelin/ERC2981.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC2981 | abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function... | /**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the f... | NatSpecMultiLine | _feeDenominator | function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
| /**
* @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
* fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
* override.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
1272,
1371
]
} | 17,816 | ||
NFT | contracts/openzeppelin/ERC2981.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC2981 | abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function... | /**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the f... | NatSpecMultiLine | _setDefaultRoyalty | function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: invalid receiver");
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
| /**
* @dev Sets the royalty information that all ids in this contract will default to.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
1628,
1959
]
} | 17,817 | ||
NFT | contracts/openzeppelin/ERC2981.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC2981 | abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function... | /**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the f... | NatSpecMultiLine | _deleteDefaultRoyalty | function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
| /**
* @dev Removes default royalty information.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
2026,
2123
]
} | 17,818 | ||
NFT | contracts/openzeppelin/ERC2981.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC2981 | abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function... | /**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the f... | NatSpecMultiLine | _setTokenRoyalty | function _setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: Invalid parameters");
_tokenRoyaltyInfo[tokenId] = RoyaltyIn... | /**
* @dev Sets the royalty information for a specific token id, overriding the global default.
*
* Requirements:
*
* - `tokenId` must be already minted.
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
2432,
2817
]
} | 17,819 | ||
NFT | contracts/openzeppelin/ERC2981.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC2981 | abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function... | /**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the f... | NatSpecMultiLine | _resetTokenRoyalty | function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
| /**
* @dev Resets royalty information for the token id back to the global default.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
2919,
3035
]
} | 17,820 | ||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | deposit | function deposit(
address tokenIn,
uint256 tokenAmountIn,
uint256 minPoolAmountOut,
uint256 liquidationFee
) public {
// pull underlying token here
IERC20(tokenIn).transferFrom(msg.sender, address(this), tokenAmountIn);
//take fee before swap
uint256 amountMinusFee = tokenAmountIn.mul(p... | /**
This methods performs the following actions:
1. pull token for user
2. joinswap into balancer pool, recieving lp
3. stake lp tokens into Wrapping Contrat which mints SOV to User
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | {
"func_code_index": [
1100,
2188
]
} | 17,821 | ||||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | depositAll | function depositAll(
uint256 poolAmountOut,
uint256[] calldata maxTokensAmountIn,
uint256 liquidationFee
) public {
address[] memory tokens = getPoolTokens();
uint256[] memory amountsIn = _getTokensAmountIn(
poolAmountOut,
maxTokensAmountIn
);
uint256[] memory amountsInMinus... | /**
This methods performs the following actions:
1. pull tokens for user
2. join into balancer pool, recieving lp
3. stake lp tokens into Wrapping Contrat which mints SOV to User
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | {
"func_code_index": [
2424,
3983
]
} | 17,822 | ||||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | withdraw | function withdraw(
address tokenOut,
uint256 poolAmountIn,
uint256 minAmountOut
) public {
require(
sovToken.balanceOf(msg.sender) >= poolAmountIn,
"Not enought SOV tokens"
);
// burns SOV from sender
sovToken.burn(msg.sender, poolAmountIn);
//recieve LP from sender to h... | /**
This methods performs the following actions:
1. burn SOV from user and unstake lp
2. exitswap lp into one of the underlyings
3. send the underlying to the User
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | {
"func_code_index": [
4204,
5223
]
} | 17,823 | ||||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | withdrawAll | function withdrawAll(uint256 poolAmountIn, uint256[] memory minAmountsOut)
public
{
address[] memory tokens = getPoolTokens();
uint256[] memory balancesBefore = new uint256[](tokens.length);
require(
sovToken.balanceOf(msg.sender) >= poolAmountIn,
"Not enought SOV tokens"
);
//... | /**
This methods performs the following actions:
1. burn SOV from user and unstake lp
2. exitswap lp into all of the underlyings
3. send the underlyings to the User
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | {
"func_code_index": [
5445,
6795
]
} | 17,824 | ||||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | liquidate | function liquidate(
address liquidatedUser,
address tokenOut,
uint256 poolAmountIn,
uint256 minAmountOut
) public {
require(
sovToken.balanceOf(msg.sender) >= poolAmountIn,
"Not enought SOV tokens"
);
// burns SOV from sender
sovToken.burn(msg.sender, poolAmountIn);
... | /**
This methods performs the following actions:
1. burn SOV from caller and unstake lp of liquidatedUser
2. exitswap lp into one of the underlyings
3. send the underlying to the caller
4. transfer fee from caller to liquidatedUser
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | {
"func_code_index": [
7096,
8807
]
} | 17,825 | ||||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | collectFeesToDAO | function collectFeesToDAO(address token) public {
uint256 balance = IERC20(token).balanceOf(address(this));
IERC20(token).transfer(treasury, balance);
}
| // transfer the entire fees collected in this contract to DAO treasury | LineComment | v0.7.6+commit.7338295f | {
"func_code_index": [
8884,
9060
]
} | 17,826 | ||||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | getPoolTokens | function getPoolTokens() public view returns (address[] memory) {
BPool bPool = smartPool.bPool();
return bPool.getCurrentTokens();
}
| // gets all tokens currently in the pool | LineComment | v0.7.6+commit.7338295f | {
"func_code_index": [
9138,
9295
]
} | 17,827 | ||||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | getTokenWeights | function getTokenWeights() public view returns (uint256[] memory) {
address[] memory tokens = getPoolTokens();
uint256[] memory weights = new uint256[](tokens.length);
for (uint256 i = 0; i < tokens.length; i++) {
weights[i] = smartPool.getDenormalizedWeight(tokens[i]);
}
return weights;
}
| // gets all tokens currently in the pool | LineComment | v0.7.6+commit.7338295f | {
"func_code_index": [
9342,
9693
]
} | 17,828 | ||||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | getSovAmountOutSingle | function getSovAmountOutSingle(
address tokenIn,
uint256 tokenAmountIn,
uint256 minPoolAmountOut
) public view returns (uint256 poolAmountOut) {
BPool bPool = smartPool.bPool();
require(bPool.isBound(tokenIn), "ERR_NOT_BOUND");
//apply protocol fee
uint256 tokenAmountInAdj = tokenAmountIn.m... | // gets current LP exchange rate for single Asset | LineComment | v0.7.6+commit.7338295f | {
"func_code_index": [
9749,
10547
]
} | 17,829 | ||||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | getTokensAmountIn | function getTokensAmountIn(
uint256 poolAmountOut,
uint256[] calldata maxAmountsIn
) public view returns (uint256[] memory actualAmountsIn) {
BPool bPool = smartPool.bPool();
uint256 poolAmountOutAdj = poolAmountOut.mul(protocolFee).div(
PROTOCOL_FEE_DECIMALS
);
address[] memory tokens ... | // gets current LP exchange rate for single Asset | LineComment | v0.7.6+commit.7338295f | {
"func_code_index": [
10603,
12193
]
} | 17,830 | ||||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | getSovAmountInSingle | function getSovAmountInSingle(
address tokenOut,
uint256 tokenAmountOut,
uint256 maxPoolAmountIn
) public view returns (uint256 poolAmountIn) {
BPool bPool = smartPool.bPool();
require(bPool.isBound(tokenOut), "ERR_NOT_BOUND");
//apply protocol fee
uint256 tokenAmountOutAdj = tokenAmountOut... | // gets current LP exchange rate for single token | LineComment | v0.7.6+commit.7338295f | {
"func_code_index": [
12249,
13271
]
} | 17,831 | ||||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | getTokenAmountOutSingle | function getTokenAmountOutSingle(
address tokenOut,
uint256 poolAmountIn,
uint256 minTokenAmountOut
) public view returns (uint256 tokenAmountOut) {
BPool bPool = smartPool.bPool();
require(bPool.isBound(tokenOut), "ERR_NOT_BOUND");
//apply protocol fee
uint256 poolAmountInAdj = poolAmountI... | // gets current LP exchange rate for single token | LineComment | v0.7.6+commit.7338295f | {
"func_code_index": [
13327,
14271
]
} | 17,832 | ||||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | getTokensAmountOut | function getTokensAmountOut(
uint256 poolAmountIn,
uint256[] calldata minAmountsOut
) public view returns (uint256[] memory actualAmountsOut) {
BPool bPool = smartPool.bPool();
address[] memory tokens = bPool.getCurrentTokens();
require(minAmountsOut.length == tokens.length, "ERR_AMOUNTS_MISMATCH")... | // gets current LP exchange rate for all | LineComment | v0.7.6+commit.7338295f | {
"func_code_index": [
14318,
15774
]
} | 17,833 | ||||
PoolRouter | contracts/wrapper/PoolRouter.sol | 0xb59008414bc3087229d3cd09537946081b74f4cd | Solidity | PoolRouter | contract PoolRouter {
using SafeMath for uint256;
uint256 public constant LIQ_FEE_DECIMALS = 1000000; // 6 decimals
uint256 public constant PROTOCOL_FEE_DECIMALS = 100000; // 5 decimals
uint256 public constant MAX_OUT_RATIO = (uint256(10**18) / 3) + 1;
uint256 public protocolFee = 99950; // 100% -... | _getTokensAmountIn | function _getTokensAmountIn(
uint256 poolAmountOut,
uint256[] calldata maxAmountsIn
) internal view returns (uint256[] memory actualAmountsIn) {
address manager = smartPool.getSmartPoolManagerVersion();
return
SmartPoolManager(manager).joinPool(
ConfigurableRightsPool(address(smartPo... | // gets current LP exchange rate for single Asset | LineComment | v0.7.6+commit.7338295f | {
"func_code_index": [
15830,
16303
]
} | 17,834 | ||||
NFT | contracts/NFT.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | NFT | contract NFT is ERC721Enumerable, Ownable, ERC2981 {
using ECDSA for bytes32;
// Base URI
string private _baseURI;
// Mapping from whitelist ID to bool determining if the sale is open to that list
mapping(uint256 => bool) private _canMint;
// Mapping from nonce value to bool documenting wheth... | /**
* @title Ballerz NFT of your team
* @notice In this NFT sale we chose to only allow transactions signed by our server, in order to prioritize human buyers
* over bots.
*/ | NatSpecMultiLine | buy | function buy(
uint256 mintList,
uint256 nonceSeq,
uint256 numTokens,
bytes memory sig
) external payable {
require(checkSig(mintList, numTokens, nonceSeq, msg.sender, msg.value, sig), "Invalid signature");
_buy(mintList, nonceSeq, numTokens);
}
| /**
* @notice Buy NFTs with transactions signed by our server, to prioritize human buyers over bots.
* @param mintList The whitelist the buyer is part of.
* @param nonceSeq The nonce of this transaction; must be unique to protect against replay attacks.
* @param numTokens The number of tokens to mint in this transa... | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
1896,
2200
]
} | 17,835 | ||
NFT | contracts/NFT.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | NFT | contract NFT is ERC721Enumerable, Ownable, ERC2981 {
using ECDSA for bytes32;
// Base URI
string private _baseURI;
// Mapping from whitelist ID to bool determining if the sale is open to that list
mapping(uint256 => bool) private _canMint;
// Mapping from nonce value to bool documenting wheth... | /**
* @title Ballerz NFT of your team
* @notice In this NFT sale we chose to only allow transactions signed by our server, in order to prioritize human buyers
* over bots.
*/ | NatSpecMultiLine | burn | function burn(uint256) external pure {
revert("Burn is not supported");
}
| /**
* @notice Burn is not supported, because the gas optimizations we've implemented make it so that burning tokens renders
* other functions buggy, like {totalSupply} and {tokenByIndex}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
2412,
2501
]
} | 17,836 | ||
NFT | contracts/NFT.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | NFT | contract NFT is ERC721Enumerable, Ownable, ERC2981 {
using ECDSA for bytes32;
// Base URI
string private _baseURI;
// Mapping from whitelist ID to bool determining if the sale is open to that list
mapping(uint256 => bool) private _canMint;
// Mapping from nonce value to bool documenting wheth... | /**
* @title Ballerz NFT of your team
* @notice In this NFT sale we chose to only allow transactions signed by our server, in order to prioritize human buyers
* over bots.
*/ | NatSpecMultiLine | tokenURI | function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(tokenId > 0 && _exists(tokenId), "Token does not exist.");
return string(abi.encodePacked(_baseURI, Strings.toString(tokenId)));
}
| /**
* Public View Functions
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
2549,
2793
]
} | 17,837 | ||
NFT | contracts/NFT.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | NFT | contract NFT is ERC721Enumerable, Ownable, ERC2981 {
using ECDSA for bytes32;
// Base URI
string private _baseURI;
// Mapping from whitelist ID to bool determining if the sale is open to that list
mapping(uint256 => bool) private _canMint;
// Mapping from nonce value to bool documenting wheth... | /**
* @title Ballerz NFT of your team
* @notice In this NFT sale we chose to only allow transactions signed by our server, in order to prioritize human buyers
* over bots.
*/ | NatSpecMultiLine | tokenByIndex | function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index + 1 < _owners.length, "ERC721Enumerable: global index out of bounds");
return index + 1;
}
| /**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
3268,
3482
]
} | 17,838 | ||
NFT | contracts/NFT.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | NFT | contract NFT is ERC721Enumerable, Ownable, ERC2981 {
using ECDSA for bytes32;
// Base URI
string private _baseURI;
// Mapping from whitelist ID to bool determining if the sale is open to that list
mapping(uint256 => bool) private _canMint;
// Mapping from nonce value to bool documenting wheth... | /**
* @title Ballerz NFT of your team
* @notice In this NFT sale we chose to only allow transactions signed by our server, in order to prioritize human buyers
* over bots.
*/ | NatSpecMultiLine | supportsInterface | function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC2981, ERC721Enumerable)
returns (bool)
{
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
| /**
* @dev See {IERC165-supportsInterface}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
3545,
3816
]
} | 17,839 | ||
NFT | contracts/NFT.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | NFT | contract NFT is ERC721Enumerable, Ownable, ERC2981 {
using ECDSA for bytes32;
// Base URI
string private _baseURI;
// Mapping from whitelist ID to bool determining if the sale is open to that list
mapping(uint256 => bool) private _canMint;
// Mapping from nonce value to bool documenting wheth... | /**
* @title Ballerz NFT of your team
* @notice In this NFT sale we chose to only allow transactions signed by our server, in order to prioritize human buyers
* over bots.
*/ | NatSpecMultiLine | _buy | function _buy(
uint256 mintList,
uint256 nonceSeq,
uint256 numTokens
) internal {
require(numTokens > 0 && numTokens <= 10, "numTokens must be between 1 and 10");
require(_canMint[mintList], "mintList not open");
require(_nonceUsed[nonceSeq] == false, "Nonce already used");
_nonceUsed[nonce... | /**
* Internal Functions
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
3861,
4268
]
} | 17,840 | ||
NFT | contracts/NFT.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | NFT | contract NFT is ERC721Enumerable, Ownable, ERC2981 {
using ECDSA for bytes32;
// Base URI
string private _baseURI;
// Mapping from whitelist ID to bool determining if the sale is open to that list
mapping(uint256 => bool) private _canMint;
// Mapping from nonce value to bool documenting wheth... | /**
* @title Ballerz NFT of your team
* @notice In this NFT sale we chose to only allow transactions signed by our server, in order to prioritize human buyers
* over bots.
*/ | NatSpecMultiLine | checkSig | function checkSig(
uint256 mintList,
uint256 numTokens,
uint256 nonceSeq,
address user,
uint256 price,
bytes memory sig
) internal view returns (bool) {
bytes32 hash = keccak256(
abi.encodePacked(
"\x19Ethereum Signed Message:\n32",
keccak256(abi.encode(mintLi... | /**
* @dev Added nonce and contract address in sig to guard against replay attacks
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
4662,
5166
]
} | 17,841 | ||
NFT | contracts/NFT.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | NFT | contract NFT is ERC721Enumerable, Ownable, ERC2981 {
using ECDSA for bytes32;
// Base URI
string private _baseURI;
// Mapping from whitelist ID to bool determining if the sale is open to that list
mapping(uint256 => bool) private _canMint;
// Mapping from nonce value to bool documenting wheth... | /**
* @title Ballerz NFT of your team
* @notice In this NFT sale we chose to only allow transactions signed by our server, in order to prioritize human buyers
* over bots.
*/ | NatSpecMultiLine | _getMaxSupply | function _getMaxSupply() internal view returns (uint128) {
if (_maxSupply == 0) {
// We actually have 8888 tokens, we're just starting at ID 1
return 8889;
}
return _maxSupply;
}
| /**
* @dev this function is designed to allow the compiler to inline.
* @return the real max supply plus one, because token IDs start at one.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
5332,
5566
]
} | 17,842 | ||
NFT | contracts/NFT.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | NFT | contract NFT is ERC721Enumerable, Ownable, ERC2981 {
using ECDSA for bytes32;
// Base URI
string private _baseURI;
// Mapping from whitelist ID to bool determining if the sale is open to that list
mapping(uint256 => bool) private _canMint;
// Mapping from nonce value to bool documenting wheth... | /**
* @title Ballerz NFT of your team
* @notice In this NFT sale we chose to only allow transactions signed by our server, in order to prioritize human buyers
* over bots.
*/ | NatSpecMultiLine | ownerMint | function ownerMint(uint256 numTokens) external onlyOwner {
require(totalSupply() + numTokens <= 250, "Owner cannot mint more than 250 tokens");
_mintTokens(numTokens);
}
| /**
* @notice Owner must mint before the sale starts, to get the first 250 tokens.
* @dev We're avoiding using {balanceOf} because it would use up a lot of gas.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
5791,
5984
]
} | 17,843 | ||
NFT | contracts/NFT.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | NFT | contract NFT is ERC721Enumerable, Ownable, ERC2981 {
using ECDSA for bytes32;
// Base URI
string private _baseURI;
// Mapping from whitelist ID to bool determining if the sale is open to that list
mapping(uint256 => bool) private _canMint;
// Mapping from nonce value to bool documenting wheth... | /**
* @title Ballerz NFT of your team
* @notice In this NFT sale we chose to only allow transactions signed by our server, in order to prioritize human buyers
* over bots.
*/ | NatSpecMultiLine | setDefaultRoyalty | function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyOwner {
_setDefaultRoyalty(receiver, feeNumerator);
}
| /**
* @dev External onlyOwner version of {ERC2981-_setDefaultRoyalty}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
7112,
7260
]
} | 17,844 | ||
NFT | contracts/NFT.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | NFT | contract NFT is ERC721Enumerable, Ownable, ERC2981 {
using ECDSA for bytes32;
// Base URI
string private _baseURI;
// Mapping from whitelist ID to bool determining if the sale is open to that list
mapping(uint256 => bool) private _canMint;
// Mapping from nonce value to bool documenting wheth... | /**
* @title Ballerz NFT of your team
* @notice In this NFT sale we chose to only allow transactions signed by our server, in order to prioritize human buyers
* over bots.
*/ | NatSpecMultiLine | deleteDefaultRoyalty | function deleteDefaultRoyalty() external onlyOwner {
_deleteDefaultRoyalty();
}
| /**
* @dev External onlyOwner version of {ERC2981-_deleteDefaultRoyalty}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
7353,
7448
]
} | 17,845 | ||
NFT | contracts/NFT.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | NFT | contract NFT is ERC721Enumerable, Ownable, ERC2981 {
using ECDSA for bytes32;
// Base URI
string private _baseURI;
// Mapping from whitelist ID to bool determining if the sale is open to that list
mapping(uint256 => bool) private _canMint;
// Mapping from nonce value to bool documenting wheth... | /**
* @title Ballerz NFT of your team
* @notice In this NFT sale we chose to only allow transactions signed by our server, in order to prioritize human buyers
* over bots.
*/ | NatSpecMultiLine | setTokenRoyalty | function setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) external onlyOwner {
_setTokenRoyalty(tokenId, receiver, feeNumerator);
}
| /**
* @dev External onlyOwner version of {ERC2981-_setTokenRoyalty}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
7536,
7736
]
} | 17,846 | ||
NFT | contracts/NFT.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | NFT | contract NFT is ERC721Enumerable, Ownable, ERC2981 {
using ECDSA for bytes32;
// Base URI
string private _baseURI;
// Mapping from whitelist ID to bool determining if the sale is open to that list
mapping(uint256 => bool) private _canMint;
// Mapping from nonce value to bool documenting wheth... | /**
* @title Ballerz NFT of your team
* @notice In this NFT sale we chose to only allow transactions signed by our server, in order to prioritize human buyers
* over bots.
*/ | NatSpecMultiLine | resetTokenRoyalty | function resetTokenRoyalty(uint256 tokenId) external onlyOwner {
_resetTokenRoyalty(tokenId);
}
| /**
* @dev External onlyOwner version of {ERC2981-_resetTokenRoyalty}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
7826,
7937
]
} | 17,847 | ||
CCS | CCS.sol | 0x2b85cea4e0ee23468b54e0bfe8284f4c308cfe37 | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.se... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
| /**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.5.11+commit.c082d0b4 | MIT | bzzr://0bf7fc711ef4fa1fc4dbd9c4b73ee151c5e20c98d44016c3fba6cf57f4a8d9b7 | {
"func_code_index": [
673,
870
]
} | 17,848 |
CCS | CCS.sol | 0x2b85cea4e0ee23468b54e0bfe8284f4c308cfe37 | Solidity | BasicToken | contract BasicToken is ERC20Basic, Ownable {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(addre... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | transfer | function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balanceOf(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_v... | /**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.5.11+commit.c082d0b4 | MIT | bzzr://0bf7fc711ef4fa1fc4dbd9c4b73ee151c5e20c98d44016c3fba6cf57f4a8d9b7 | {
"func_code_index": [
293,
722
]
} | 17,849 |
CCS | CCS.sol | 0x2b85cea4e0ee23468b54e0bfe8284f4c308cfe37 | Solidity | BasicToken | contract BasicToken is ERC20Basic, Ownable {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(addre... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
| /**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/ | NatSpecMultiLine | v0.5.11+commit.c082d0b4 | MIT | bzzr://0bf7fc711ef4fa1fc4dbd9c4b73ee151c5e20c98d44016c3fba6cf57f4a8d9b7 | {
"func_code_index": [
939,
1059
]
} | 17,850 |
CCS | CCS.sol | 0x2b85cea4e0ee23468b54e0bfe8284f4c308cfe37 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer t... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(allowed[_from][msg.sender] >= _value);
require(balanceOf(_from) >= _value);
require(balances[_to].add(_value) > balances[_to]); // Check for overflows
balances[_from] = ... | /**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/ | NatSpecMultiLine | v0.5.11+commit.c082d0b4 | MIT | bzzr://0bf7fc711ef4fa1fc4dbd9c4b73ee151c5e20c98d44016c3fba6cf57f4a8d9b7 | {
"func_code_index": [
399,
975
]
} | 17,851 |
CCS | CCS.sol | 0x2b85cea4e0ee23468b54e0bfe8284f4c308cfe37 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer t... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | approve | function approve(address _spender, uint256 _value) public returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/... | /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/ | NatSpecMultiLine | v0.5.11+commit.c082d0b4 | MIT | bzzr://0bf7fc711ef4fa1fc4dbd9c4b73ee151c5e20c98d44016c3fba6cf57f4a8d9b7 | {
"func_code_index": [
1217,
1809
]
} | 17,852 |
CCS | CCS.sol | 0x2b85cea4e0ee23468b54e0bfe8284f4c308cfe37 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer t... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | allowance | function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
| /**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/ | NatSpecMultiLine | v0.5.11+commit.c082d0b4 | MIT | bzzr://0bf7fc711ef4fa1fc4dbd9c4b73ee151c5e20c98d44016c3fba6cf57f4a8d9b7 | {
"func_code_index": [
2140,
2289
]
} | 17,853 |
CCS | CCS.sol | 0x2b85cea4e0ee23468b54e0bfe8284f4c308cfe37 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer t... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | increaseApproval | function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| /**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/ | NatSpecMultiLine | v0.5.11+commit.c082d0b4 | MIT | bzzr://0bf7fc711ef4fa1fc4dbd9c4b73ee151c5e20c98d44016c3fba6cf57f4a8d9b7 | {
"func_code_index": [
2542,
2836
]
} | 17,854 |
CCS | CCS.sol | 0x2b85cea4e0ee23468b54e0bfe8284f4c308cfe37 | Solidity | Pausable | contract Pausable is StandardToken {
event Pause();
event Unpause();
bool public paused = false;
address public founder;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(!paused || msg.sender == founder... | /**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/ | NatSpecMultiLine | pause | function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
| /**
* @dev called by the owner to pause, triggers stopped state
*/ | NatSpecMultiLine | v0.5.11+commit.c082d0b4 | MIT | bzzr://0bf7fc711ef4fa1fc4dbd9c4b73ee151c5e20c98d44016c3fba6cf57f4a8d9b7 | {
"func_code_index": [
595,
703
]
} | 17,855 |
CCS | CCS.sol | 0x2b85cea4e0ee23468b54e0bfe8284f4c308cfe37 | Solidity | Pausable | contract Pausable is StandardToken {
event Pause();
event Unpause();
bool public paused = false;
address public founder;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(!paused || msg.sender == founder... | /**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/ | NatSpecMultiLine | unpause | function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
| /**
* @dev called by the owner to unpause, returns to normal state
*/ | NatSpecMultiLine | v0.5.11+commit.c082d0b4 | MIT | bzzr://0bf7fc711ef4fa1fc4dbd9c4b73ee151c5e20c98d44016c3fba6cf57f4a8d9b7 | {
"func_code_index": [
791,
901
]
} | 17,856 |
CCS | CCS.sol | 0x2b85cea4e0ee23468b54e0bfe8284f4c308cfe37 | Solidity | PausableToken | contract PausableToken is Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transf... | approve | function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
| //The functions below surve no real purpose. Even if one were to approve another to spend
//tokens on their behalf, those tokens will still only be transferable when the token contract
//is not paused. | LineComment | v0.5.11+commit.c082d0b4 | MIT | bzzr://0bf7fc711ef4fa1fc4dbd9c4b73ee151c5e20c98d44016c3fba6cf57f4a8d9b7 | {
"func_code_index": [
577,
726
]
} | 17,857 | ||
CCS | CCS.sol | 0x2b85cea4e0ee23468b54e0bfe8284f4c308cfe37 | Solidity | CCS | contract CCS is PausableToken {
string public name;
string public symbol;
uint8 public decimals;
/**
* @dev Constructor that gives the founder all of the existing tokens.
*/
constructor() public {
name = "Crypto Copyright System";
symbol = "CCS";
decimal... | getFrozenBalance | function getFrozenBalance(address _owner) view public returns(uint256) {
return frozenTokenBalances[_owner];
}
| /**
* @dev Gets the amount of tokens which belong to the specified address BUT are frozen now.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount of frozen tokens owned by the passed address.
*/ | NatSpecMultiLine | v0.5.11+commit.c082d0b4 | MIT | bzzr://0bf7fc711ef4fa1fc4dbd9c4b73ee151c5e20c98d44016c3fba6cf57f4a8d9b7 | {
"func_code_index": [
2612,
2744
]
} | 17,858 | ||
CCS | CCS.sol | 0x2b85cea4e0ee23468b54e0bfe8284f4c308cfe37 | Solidity | CCS | contract CCS is PausableToken {
string public name;
string public symbol;
uint8 public decimals;
/**
* @dev Constructor that gives the founder all of the existing tokens.
*/
constructor() public {
name = "Crypto Copyright System";
symbol = "CCS";
decimal... | burnTokens | function burnTokens(uint256 _tokens) public onlyOwner {
require(balanceOf(msg.sender) >= _tokens);
balances[msg.sender] = balances[msg.sender].sub(_tokens);
totalSupply = totalSupply.sub(_tokens);
emit TokensBurned(msg.sender, _tokens);
}
| /*
* @dev Token burn function
* @param _tokens uint256 amount of tokens to burn
*/ | Comment | v0.5.11+commit.c082d0b4 | MIT | bzzr://0bf7fc711ef4fa1fc4dbd9c4b73ee151c5e20c98d44016c3fba6cf57f4a8d9b7 | {
"func_code_index": [
2854,
3138
]
} | 17,859 | ||
IdentityRegistry | contracts/registry/IdentityRegistry.sol | 0xcbd79142f1bb10039bf33e4e8574633590dab5c0 | Solidity | IdentityRegistry | contract IdentityRegistry is IIdentityRegistry, AgentRole {
// mapping between a user address and the corresponding identity contract
mapping (address => Identity) public identity;
mapping (address => uint16) public investorCountry;
IClaimTopicsRegistry public topicsRegistry;
ITrustedIssuer... | registerIdentity | function registerIdentity(address _user, Identity _identity, uint16 _country) public onlyAgent {
require(address(_identity) != address(0), "contract address can't be a zero address");
require(address(identity[_user]) == address(0), "identity contract already exists, please use update");
identity[_user] =... | /**
* @notice Register an identity contract corresponding to a user address.
* Requires that the user doesn't have an identity contract already registered.
* Only agent can call.
*
* @param _user The address of the user
* @param _identity The address of the user's identity contract
* @param _country The c... | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | None | bzzr://c17dcebeb8852dd89f661714d9058fdc878012d312285c15fa489257d67d8e5b | {
"func_code_index": [
1133,
1586
]
} | 17,860 | ||
IdentityRegistry | contracts/registry/IdentityRegistry.sol | 0xcbd79142f1bb10039bf33e4e8574633590dab5c0 | Solidity | IdentityRegistry | contract IdentityRegistry is IIdentityRegistry, AgentRole {
// mapping between a user address and the corresponding identity contract
mapping (address => Identity) public identity;
mapping (address => uint16) public investorCountry;
IClaimTopicsRegistry public topicsRegistry;
ITrustedIssuer... | batchRegisterIdentity | function batchRegisterIdentity(address[] calldata _users, Identity[] calldata _identities, uint16[] calldata _countries) external {
for (uint256 i = 0; i < _users.length; i++) {
registerIdentity(_users[i], _identities[i], _countries[i]);
}
}
| /**
* @notice function allowing to register identities in batch
* Only Agent can call this function.
* Requires that none of the users has an identity contract already registered.
*
* IMPORTANT : THIS TRANSACTION COULD EXCEED GAS LIMIT IF `_users.length` IS TOO HIGH,
* USE WITH CARE OR YOU COULD LOSE TX... | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | None | bzzr://c17dcebeb8852dd89f661714d9058fdc878012d312285c15fa489257d67d8e5b | {
"func_code_index": [
2179,
2461
]
} | 17,861 | ||
IdentityRegistry | contracts/registry/IdentityRegistry.sol | 0xcbd79142f1bb10039bf33e4e8574633590dab5c0 | Solidity | IdentityRegistry | contract IdentityRegistry is IIdentityRegistry, AgentRole {
// mapping between a user address and the corresponding identity contract
mapping (address => Identity) public identity;
mapping (address => uint16) public investorCountry;
IClaimTopicsRegistry public topicsRegistry;
ITrustedIssuer... | updateIdentity | function updateIdentity(address _user, Identity _identity) public onlyAgent {
require(address(identity[_user]) != address(0));
require(address(_identity) != address(0), "contract address can't be a zero address");
identity[_user] = _identity;
emit IdentityUpdated(identity[_user], _identity);
}
| /**
* @notice Updates an identity contract corresponding to a user address.
* Requires that the user address should be the owner of the identity contract.
* Requires that the user should have an identity contract already deployed that will be replaced.
* Only owner can call.
*
* @param _user The address of ... | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | None | bzzr://c17dcebeb8852dd89f661714d9058fdc878012d312285c15fa489257d67d8e5b | {
"func_code_index": [
2896,
3238
]
} | 17,862 | ||
IdentityRegistry | contracts/registry/IdentityRegistry.sol | 0xcbd79142f1bb10039bf33e4e8574633590dab5c0 | Solidity | IdentityRegistry | contract IdentityRegistry is IIdentityRegistry, AgentRole {
// mapping between a user address and the corresponding identity contract
mapping (address => Identity) public identity;
mapping (address => uint16) public investorCountry;
IClaimTopicsRegistry public topicsRegistry;
ITrustedIssuer... | updateCountry | function updateCountry(address _user, uint16 _country) public onlyAgent {
require(address(identity[_user])!= address(0));
investorCountry[_user] = _country;
emit CountryUpdated(_user, _country);
}
| /**
* @notice Updates the country corresponding to a user address.
* Requires that the user should have an identity contract already deployed that will be replaced.
* Only owner can call.
*
* @param _user The address of the user
* @param _country The new country of the user
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | None | bzzr://c17dcebeb8852dd89f661714d9058fdc878012d312285c15fa489257d67d8e5b | {
"func_code_index": [
3563,
3798
]
} | 17,863 | ||
IdentityRegistry | contracts/registry/IdentityRegistry.sol | 0xcbd79142f1bb10039bf33e4e8574633590dab5c0 | Solidity | IdentityRegistry | contract IdentityRegistry is IIdentityRegistry, AgentRole {
// mapping between a user address and the corresponding identity contract
mapping (address => Identity) public identity;
mapping (address => uint16) public investorCountry;
IClaimTopicsRegistry public topicsRegistry;
ITrustedIssuer... | deleteIdentity | function deleteIdentity(address _user) public onlyAgent {
require(address(identity[_user]) != address(0), "you haven't registered an identity yet");
delete identity[_user];
emit IdentityRemoved(_user, identity[_user]);
}
| /**
* @notice Removes an user from the identity registry.
* Requires that the user have an identity contract already deployed that will be deleted.
* Only owner can call.
*
* @param _user The address of the user to be removed
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | None | bzzr://c17dcebeb8852dd89f661714d9058fdc878012d312285c15fa489257d67d8e5b | {
"func_code_index": [
4065,
4324
]
} | 17,864 | ||
IdentityRegistry | contracts/registry/IdentityRegistry.sol | 0xcbd79142f1bb10039bf33e4e8574633590dab5c0 | Solidity | IdentityRegistry | contract IdentityRegistry is IIdentityRegistry, AgentRole {
// mapping between a user address and the corresponding identity contract
mapping (address => Identity) public identity;
mapping (address => uint16) public investorCountry;
IClaimTopicsRegistry public topicsRegistry;
ITrustedIssuer... | isVerified | function isVerified(address _userAddress) public view returns (bool) {
if (address(identity[_userAddress]) == address(0)){
return false;
}
uint256[] memory claimTopics = topicsRegistry.getClaimTopics();
uint length = claimTopics.length;
if (length == 0) {
return true;
}... | /**
* @notice This functions checks whether an identity contract
* corresponding to the provided user address has the required claims or not based
* on the security token.
*
* @param _userAddress The address of the user to be verified.
*
* @return 'True' if the address is verified, 'false' if not.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | None | bzzr://c17dcebeb8852dd89f661714d9058fdc878012d312285c15fa489257d67d8e5b | {
"func_code_index": [
4676,
6186
]
} | 17,865 | ||
IdentityRegistry | contracts/registry/IdentityRegistry.sol | 0xcbd79142f1bb10039bf33e4e8574633590dab5c0 | Solidity | IdentityRegistry | contract IdentityRegistry is IIdentityRegistry, AgentRole {
// mapping between a user address and the corresponding identity contract
mapping (address => Identity) public identity;
mapping (address => uint16) public investorCountry;
IClaimTopicsRegistry public topicsRegistry;
ITrustedIssuer... | setClaimTopicsRegistry | function setClaimTopicsRegistry(address _claimTopicsRegistry) public onlyOwner {
topicsRegistry = IClaimTopicsRegistry(_claimTopicsRegistry);
emit ClaimTopicsRegistrySet(_claimTopicsRegistry);
}
| // Registry setters | LineComment | v0.5.10+commit.5a6ea5b1 | None | bzzr://c17dcebeb8852dd89f661714d9058fdc878012d312285c15fa489257d67d8e5b | {
"func_code_index": [
6214,
6438
]
} | 17,866 | ||
CNSRegistryForwarder | @openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol | 0x97b0e89fc1b7ed4a8b237d9d8fcce9b234f25a37 | Solidity | ECDSAUpgradeable | library ECDSAUpgradeable {
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring... | /**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/ | NatSpecMultiLine | recover | function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
// Divide the signature in r, s and v variables
bytes32 r;
bytes32 s;
uint8 v;
// Check the signature length
// - case 65: r,s,v signature (standard)
// - case 64: r,vs signature (cf https://eips.ethere... | /**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, an... | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | {
"func_code_index": [
807,
2270
]
} | 17,867 | ||
CNSRegistryForwarder | @openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol | 0x97b0e89fc1b7ed4a8b237d9d8fcce9b234f25a37 | Solidity | ECDSAUpgradeable | library ECDSAUpgradeable {
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring... | /**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/ | NatSpecMultiLine | recover | function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defi... | /**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | {
"func_code_index": [
2399,
3814
]
} | 17,868 | ||
CNSRegistryForwarder | @openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol | 0x97b0e89fc1b7ed4a8b237d9d8fcce9b234f25a37 | Solidity | ECDSAUpgradeable | library ECDSAUpgradeable {
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring... | /**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/ | NatSpecMultiLine | toEthSignedMessageHash | function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
| /**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | {
"func_code_index": [
4100,
4369
]
} | 17,869 | ||
CNSRegistryForwarder | @openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol | 0x97b0e89fc1b7ed4a8b237d9d8fcce9b234f25a37 | Solidity | ECDSAUpgradeable | library ECDSAUpgradeable {
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring... | /**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/ | NatSpecMultiLine | toTypedDataHash | function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
| /**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | {
"func_code_index": [
4704,
4902
]
} | 17,870 | ||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | supportsInterface | function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
| /**
* @dev See {IERC165-supportsInterface}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
697,
1001
]
} | 17,871 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | balanceOf | function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
uint256 count;
for (uint256 i; i < _owners.length; ++i) {
if (owner == _owners[i]) ++count;
}
return count;
}
| /**
* @dev See {IERC721-balanceOf}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
1056,
1385
]
} | 17,872 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | ownerOf | function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
| /**
* @dev See {IERC721-ownerOf}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
1438,
1677
]
} | 17,873 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | name | function name() public view virtual override returns (string memory) {
return _name;
}
| /**
* @dev See {IERC721Metadata-name}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
1735,
1837
]
} | 17,874 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | symbol | function symbol() public view virtual override returns (string memory) {
return _symbol;
}
| /**
* @dev See {IERC721Metadata-symbol}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
1897,
2003
]
} | 17,875 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | approve | function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor appro... | /**
* @dev See {IERC721-approve}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
2056,
2461
]
} | 17,876 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | getApproved | function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
| /**
* @dev See {IERC721-getApproved}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
2518,
2739
]
} | 17,877 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | setApprovalForAll | function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
| /**
* @dev See {IERC721-setApprovalForAll}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
2802,
3096
]
} | 17,878 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | isApprovedForAll | function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
| /**
* @dev See {IERC721-isApprovedForAll}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
3158,
3324
]
} | 17,879 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | transferFrom | function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
| /**
* @dev See {IERC721-transferFrom}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
3382,
3716
]
} | 17,880 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | safeTransferFrom | function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
| /**
* @dev See {IERC721-safeTransferFrom}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
3778,
3961
]
} | 17,881 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | safeTransferFrom | function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
| /**
* @dev See {IERC721-safeTransferFrom}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
4023,
4347
]
} | 17,882 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | _safeTransfer | function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
| /**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivale... | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
5205,
5516
]
} | 17,883 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | _exists | function _exists(uint256 tokenId) internal view virtual returns (bool) {
return tokenId < _owners.length && _owners[tokenId] != address(0);
}
| /**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
5815,
5972
]
} | 17,884 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | _isApprovedOrOwner | function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spen... | /**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
6126,
6474
]
} | 17,885 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | _safeMint | function _safeMint(address to) internal virtual {
_safeMint(to, "");
}
| /**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
6800,
6886
]
} | 17,886 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | _safeMint | function _safeMint(address to, bytes memory _data) internal virtual {
uint256 tokenId = _mint(to);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
| /**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
7103,
7380
]
} | 17,887 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | _mint | function _mint(address to) internal virtual returns (uint256) {
require(to != address(0), "ERC721: mint to the zero address");
uint256 tokenId = _owners.length;
_owners.push(to);
emit Transfer(address(0), to, tokenId);
return tokenId;
}
| /**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
7698,
7986
]
} | 17,888 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | _burn | function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
// Clear approvals
_approve(address(0), tokenId);
_owners[tokenId] = address(0);
emit Transfer(owner, address(0), tokenId);
}
| /**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
8199,
8466
]
} | 17,889 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | _transfer | function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
// Clear approvals from the previous owner
_approve(ad... | /**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
8786,
9241
]
} | 17,890 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | _approve | function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
| /**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
9348,
9523
]
} | 17,891 | ||||
NFT | contracts/ERC721.sol | 0xea3e8708e33b2072e7788aaa9159547749714e3a | Solidity | ERC721 | abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenAppro... | _checkOnERC721Received | function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver... | /**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId ... | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
10072,
10854
]
} | 17,892 | ||||
BridgeBank | /private/tmp/sifnode/smart-contracts/contracts/BridgeBank/CosmosWhiteList.sol | 0xeca46baed9fbe8543b5963571aa93762343b7f9f | Solidity | CosmosWhiteList | contract CosmosWhiteList is CosmosWhiteListStorage {
bool private _initialized;
/*
* @dev: Event declarations
*/
event LogWhiteListUpdate(address _token, bool _value);
function initialize() public {
require(!_initialized, "Initialized");
_cosmosTokenWhiteList[address(0)] = tr... | /**
* @title WhiteList
* @dev WhiteList contract records the ERC 20 list that can be locked in BridgeBank.
**/ | NatSpecMultiLine | setTokenInCosmosWhiteList | function setTokenInCosmosWhiteList(address _token, bool _inList)
internal
returns (bool)
{
_cosmosTokenWhiteList[_token] = _inList;
emit LogWhiteListUpdate(_token, _inList);
return _inList;
}
| /*
* @dev: Set the token address in whitelist
*
* @param _token: ERC 20's address
* @param _inList: set the _token in list or not
* @return: new value of if _token in whitelist
*/ | Comment | v0.5.16+commit.9c3226ce | {
"func_code_index": [
859,
1102
]
} | 17,893 | ||
BridgeBank | /private/tmp/sifnode/smart-contracts/contracts/BridgeBank/CosmosWhiteList.sol | 0xeca46baed9fbe8543b5963571aa93762343b7f9f | Solidity | CosmosWhiteList | contract CosmosWhiteList is CosmosWhiteListStorage {
bool private _initialized;
/*
* @dev: Event declarations
*/
event LogWhiteListUpdate(address _token, bool _value);
function initialize() public {
require(!_initialized, "Initialized");
_cosmosTokenWhiteList[address(0)] = tr... | /**
* @title WhiteList
* @dev WhiteList contract records the ERC 20 list that can be locked in BridgeBank.
**/ | NatSpecMultiLine | getCosmosTokenInWhiteList | function getCosmosTokenInWhiteList(address _token) public view returns (bool) {
return _cosmosTokenWhiteList[_token];
}
| /*
* @dev: Get if the token in whitelist
*
* @param _token: ERC 20's address
* @return: if _token in whitelist
*/ | Comment | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1247,
1382
]
} | 17,894 | ||
BridgeBank | /private/tmp/sifnode/smart-contracts/contracts/BridgeBank/EthereumWhitelist.sol | 0xeca46baed9fbe8543b5963571aa93762343b7f9f | Solidity | EthereumWhiteList | contract EthereumWhiteList {
bool private _initialized;
/**
* @notice mapping to keep track of whitelisted tokens
*/
mapping(address => bool) private _ethereumTokenWhiteList;
/**
* @notice gap of storage for future upgrades
*/
uint256[100] private ____gap;
/*
* @dev: Event... | /**
* @title WhiteList
* @dev WhiteList contract records the ERC 20 list that can be locked in BridgeBank.
**/ | NatSpecMultiLine | setTokenInEthWhiteList | function setTokenInEthWhiteList(address _token, bool _inList)
internal
returns (bool)
{
_ethereumTokenWhiteList[_token] = _inList;
emit LogWhiteListUpdate(_token, _inList);
return _inList;
}
| /*
* @dev: Set the token address in whitelist
*
* @param _token: ERC 20's address
* @param _inList: set the _token in list or not
* @return: new value of if _token in whitelist
*/ | Comment | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1065,
1307
]
} | 17,895 | ||
BridgeBank | /private/tmp/sifnode/smart-contracts/contracts/BridgeBank/EthereumWhitelist.sol | 0xeca46baed9fbe8543b5963571aa93762343b7f9f | Solidity | EthereumWhiteList | contract EthereumWhiteList {
bool private _initialized;
/**
* @notice mapping to keep track of whitelisted tokens
*/
mapping(address => bool) private _ethereumTokenWhiteList;
/**
* @notice gap of storage for future upgrades
*/
uint256[100] private ____gap;
/*
* @dev: Event... | /**
* @title WhiteList
* @dev WhiteList contract records the ERC 20 list that can be locked in BridgeBank.
**/ | NatSpecMultiLine | getTokenInEthWhiteList | function getTokenInEthWhiteList(address _token) public view returns (bool) {
return _ethereumTokenWhiteList[_token];
}
| /*
* @dev: Get if the token in whitelist
*
* @param _token: ERC 20's address
* @return: if _token in whitelist
*/ | Comment | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1452,
1586
]
} | 17,896 | ||
BridgeBank | /private/tmp/sifnode/smart-contracts/contracts/BridgeBank/CosmosBank.sol | 0xeca46baed9fbe8543b5963571aa93762343b7f9f | Solidity | CosmosBank | contract CosmosBank is CosmosBankStorage, ToLower {
using SafeMath for uint256;
/*
* @dev: Event declarations
*/
event LogNewBridgeToken(address _token, string _symbol);
event LogBridgeTokenMint(
address _token,
string _symbol,
uint256 _amount,
address _benefi... | /**
* @title CosmosBank
* @dev Manages the deployment and minting of ERC20 compatible BridgeTokens
* which represent assets based on the Cosmos blockchain.
**/ | NatSpecMultiLine | getBridgeToken | function getBridgeToken(string memory _symbol)
public
view
returns (address)
{
return (controlledBridgeTokens[_symbol]);
}
| /*
* @dev: Get a token symbol's corresponding bridge token address.
*
* @param _symbol: The token's symbol/denom without 'e' prefix.
* @return: Address associated with the given symbol. Returns address(0) if none is found.
*/ | Comment | v0.5.16+commit.9c3226ce | {
"func_code_index": [
589,
755
]
} | 17,897 | ||
BridgeBank | /private/tmp/sifnode/smart-contracts/contracts/BridgeBank/CosmosBank.sol | 0xeca46baed9fbe8543b5963571aa93762343b7f9f | Solidity | CosmosBank | contract CosmosBank is CosmosBankStorage, ToLower {
using SafeMath for uint256;
/*
* @dev: Event declarations
*/
event LogNewBridgeToken(address _token, string _symbol);
event LogBridgeTokenMint(
address _token,
string _symbol,
uint256 _amount,
address _benefi... | /**
* @title CosmosBank
* @dev Manages the deployment and minting of ERC20 compatible BridgeTokens
* which represent assets based on the Cosmos blockchain.
**/ | NatSpecMultiLine | deployNewBridgeToken | function deployNewBridgeToken(string memory _symbol)
internal
returns (address)
{
bridgeTokenCount = bridgeTokenCount.add(1);
// Deploy new bridge token contract
BridgeToken newBridgeToken = (new BridgeToken)(_symbol);
// Set address in tokens mapping
address newBridgeTokenAddress = addres... | /*
* @dev: Deploys a new BridgeToken contract
*
* @param _symbol: The BridgeToken's symbol
*/ | Comment | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1182,
1786
]
} | 17,898 | ||
BridgeBank | /private/tmp/sifnode/smart-contracts/contracts/BridgeBank/CosmosBank.sol | 0xeca46baed9fbe8543b5963571aa93762343b7f9f | Solidity | CosmosBank | contract CosmosBank is CosmosBankStorage, ToLower {
using SafeMath for uint256;
/*
* @dev: Event declarations
*/
event LogNewBridgeToken(address _token, string _symbol);
event LogBridgeTokenMint(
address _token,
string _symbol,
uint256 _amount,
address _benefi... | /**
* @title CosmosBank
* @dev Manages the deployment and minting of ERC20 compatible BridgeTokens
* which represent assets based on the Cosmos blockchain.
**/ | NatSpecMultiLine | useExistingBridgeToken | function useExistingBridgeToken(address _contractAddress)
internal
returns (address)
{
bridgeTokenCount = bridgeTokenCount.add(1);
string memory _symbol = BridgeToken(_contractAddress).symbol();
// Set address in tokens mapping
address newBridgeTokenAddress = _contractAddress;
controlledBri... | /*
* @dev: Deploys a new BridgeToken contract
*
* @param _symbol: The BridgeToken's symbol
*
* @note the Rowan token symbol needs to be "Rowan" so that it integrates correctly with the cosmos bridge
*/ | Comment | v0.5.16+commit.9c3226ce | {
"func_code_index": [
2025,
2589
]
} | 17,899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.