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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _approve | function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "AFZA");
require(spender != address(0), "ATZA");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
| /**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero a... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
8007,
8296
]
} | 29,500 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _setupDecimals | function _setupDecimals(uint8 decimals_) internal virtual {
_decimals = decimals_;
}
| /**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
8623,
8726
]
} | 29,501 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _beforeTokenTransfer | function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
| /**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* -... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
9324,
9421
]
} | 29,502 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20Permit | abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {
using Counters for Counters.Counter;
mapping (address => Counters.Counter) private _nonces;
//keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 private immutable _PERMIT_TYPEHAS... | /**
* @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message sig... | NatSpecMultiLine | permit | function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public virtual override {
// solhint-disable-next-line not-rely-on-time
require(block.timestamp <= deadline, "ED");
bytes32 structHash = keccak256(
abi.encode(
_PERMIT_T... | /**
* @dev See {IERC20Permit-permit}.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
749,
1470
]
} | 29,503 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20Permit | abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {
using Counters for Counters.Counter;
mapping (address => Counters.Counter) private _nonces;
//keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 private immutable _PERMIT_TYPEHAS... | /**
* @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message sig... | NatSpecMultiLine | nonces | function nonces(address owner) public view virtual override returns (uint256) {
return _nonces[owner].current();
}
| /**
* @dev See {IERC20Permit-nonces}.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1531,
1664
]
} | 29,504 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20Permit | abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {
using Counters for Counters.Counter;
mapping (address => Counters.Counter) private _nonces;
//keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 private immutable _PERMIT_TYPEHAS... | /**
* @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message sig... | NatSpecMultiLine | DOMAIN_SEPARATOR | function DOMAIN_SEPARATOR() external view override returns (bytes32) {
return _domainSeparatorV4();
}
| // solhint-disable-next-line func-name-mixedcase | LineComment | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1789,
1909
]
} | 29,505 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20Permit | abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {
using Counters for Counters.Counter;
mapping (address => Counters.Counter) private _nonces;
//keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 private immutable _PERMIT_TYPEHAS... | /**
* @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message sig... | NatSpecMultiLine | _useNonce | function _useNonce(address owner) internal virtual returns (uint256 current) {
Counters.Counter storage nonce = _nonces[owner];
current = nonce.current();
nonce.increment();
}
| /**
* @dev "Consume a nonce": return the current value and increment.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2002,
2214
]
} | 29,506 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | UnsafeMath | library UnsafeMath {
/// @notice Returns ceil(x / y)
/// @dev division by 0 has unspecified behavior, and must be checked externally
/// @param x The dividend
/// @param y The divisor
/// @return z The quotient, ceil(x / y)
function divRoundingUp(uint256 x, uint256 y) internal pure returns... | /// @title Math functions that do not check inputs or outputs
/// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks | NatSpecSingleLine | divRoundingUp | function divRoundingUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
assembly {
z := add(div(x, y), gt(mod(x, y), 0))
}
}
| /// @notice Returns ceil(x / y)
/// @dev division by 0 has unspecified behavior, and must be checked externally
/// @param x The dividend
/// @param y The divisor
/// @return z The quotient, ceil(x / y) | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
250,
424
]
} | 29,507 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | UnsafeMath | library UnsafeMath {
/// @notice Returns ceil(x / y)
/// @dev division by 0 has unspecified behavior, and must be checked externally
/// @param x The dividend
/// @param y The divisor
/// @return z The quotient, ceil(x / y)
function divRoundingUp(uint256 x, uint256 y) internal pure returns... | /// @title Math functions that do not check inputs or outputs
/// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks | NatSpecSingleLine | unsafeDiv | function unsafeDiv(uint256 x, uint256 y) internal pure returns (uint256 z) {
assembly {
z := div(x, y)
}
}
| /// @notice Returns floor(x / y)
/// @dev division by 0 has unspecified behavior, and must be checked externally
/// @param x The dividend
/// @param y The divisor
/// @return z The quotient, floor(x / y) | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
657,
804
]
} | 29,508 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | FullMath | library FullMath {
/// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
/// @param a The multiplicand
/// @param b The multiplier
/// @param denominator The divisor
/// @return result The 256-bit result
/// @dev Credit ... | /// @title Contains 512-bit math functions
/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision
/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits | NatSpecSingleLine | mulDiv | function mulDiv(
uint256 a,
uint256 b,
uint256 denominator
) internal pure returns (uint256 result) {
// 512-bit multiply [prod1 prod0] = a * b
// Compute the product mod 2**256 and mod 2**256 - 1
// then use the Chinese Remainder Theorem to reconstruct
// the 512 bit result. The res... | /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
/// @param a The multiplicand
/// @param b The multiplier
/// @param denominator The divisor
/// @return result The 256-bit result
/// @dev Credit to Remco Bloemen under MIT license https://xn--2-... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
388,
4261
]
} | 29,509 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | FullMath | library FullMath {
/// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
/// @param a The multiplicand
/// @param b The multiplier
/// @param denominator The divisor
/// @return result The 256-bit result
/// @dev Credit ... | /// @title Contains 512-bit math functions
/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision
/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits | NatSpecSingleLine | mulDivRoundingUp | function mulDivRoundingUp(
uint256 a,
uint256 b,
uint256 denominator
) internal pure returns (uint256 result) {
result = mulDiv(a, b, denominator);
if (mulmod(a, b, denominator) > 0) {
require(result < type(uint256).max);
result++;
}
}
| /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
/// @param a The multiplicand
/// @param b The multiplier
/// @param denominator The divisor
/// @return result The 256-bit result | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
4543,
4873
]
} | 29,510 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SafeCast | library SafeCast {
/// @notice Cast a uint256 to a uint160, revert on overflow
/// @param y The uint256 to be downcasted
/// @return z The downcasted integer, now type uint160
function toUint160(uint256 y) internal pure returns (uint160 z) {
require((z = uint160(y)) == y);
}
///... | /// @title Safe casting methods
/// @notice Contains methods for safely casting between types | NatSpecSingleLine | toUint160 | function toUint160(uint256 y) internal pure returns (uint160 z) {
require((z = uint160(y)) == y);
}
| /// @notice Cast a uint256 to a uint160, revert on overflow
/// @param y The uint256 to be downcasted
/// @return z The downcasted integer, now type uint160 | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
192,
310
]
} | 29,511 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SafeCast | library SafeCast {
/// @notice Cast a uint256 to a uint160, revert on overflow
/// @param y The uint256 to be downcasted
/// @return z The downcasted integer, now type uint160
function toUint160(uint256 y) internal pure returns (uint160 z) {
require((z = uint160(y)) == y);
}
///... | /// @title Safe casting methods
/// @notice Contains methods for safely casting between types | NatSpecSingleLine | toUint128 | function toUint128(uint256 y) internal pure returns (uint128 z) {
require((z = uint128(y)) == y);
}
| /// @notice Cast a uint256 to a uint128, revert on overflow
/// @param y The uint256 to be downcasted
/// @return z The downcasted integer, now type uint128 | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
485,
603
]
} | 29,512 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SafeCast | library SafeCast {
/// @notice Cast a uint256 to a uint160, revert on overflow
/// @param y The uint256 to be downcasted
/// @return z The downcasted integer, now type uint160
function toUint160(uint256 y) internal pure returns (uint160 z) {
require((z = uint160(y)) == y);
}
///... | /// @title Safe casting methods
/// @notice Contains methods for safely casting between types | NatSpecSingleLine | toInt128 | function toInt128(int256 y) internal pure returns (int128 z) {
require((z = int128(y)) == y);
}
| /// @notice Cast a int256 to a int128, revert on overflow or underflow
/// @param y The int256 to be downcasted
/// @return z The downcasted integer, now type int128 | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
787,
901
]
} | 29,513 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SafeCast | library SafeCast {
/// @notice Cast a uint256 to a uint160, revert on overflow
/// @param y The uint256 to be downcasted
/// @return z The downcasted integer, now type uint160
function toUint160(uint256 y) internal pure returns (uint160 z) {
require((z = uint160(y)) == y);
}
///... | /// @title Safe casting methods
/// @notice Contains methods for safely casting between types | NatSpecSingleLine | toInt256 | function toInt256(uint256 y) internal pure returns (int256 z) {
require(y < 2**255);
z = int256(y);
}
| /// @notice Cast a uint256 to a int256, revert on overflow
/// @param y The uint256 to be casted
/// @return z The casted integer, now type int256 | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1066,
1195
]
} | 29,514 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LowGasSafeMath | library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @not... | /// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost | NatSpecSingleLine | add | function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
| /// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
187,
305
]
} | 29,515 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LowGasSafeMath | library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @not... | /// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost | NatSpecSingleLine | sub | function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x);
}
| /// @notice Returns x - y, reverts if underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
470,
588
]
} | 29,516 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LowGasSafeMath | library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @not... | /// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost | NatSpecSingleLine | mul | function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(x == 0 || (z = x * y) / x == y);
}
| /// @notice Returns x * y, reverts if overflows
/// @param x The multiplicand
/// @param y The multiplier
/// @return z The product of x and y | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
754,
886
]
} | 29,517 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LowGasSafeMath | library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @not... | /// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost | NatSpecSingleLine | sub | function sub(uint256 x, uint256 y, string memory errorMessage) internal pure returns (uint256 z) {
require((z = x - y) <= x, errorMessage);
}
| /// @notice Returns x - y, reverts if underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1051,
1211
]
} | 29,518 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LowGasSafeMath | library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @not... | /// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost | NatSpecSingleLine | add | function add(int256 x, int256 y) internal pure returns (int256 z) {
require((z = x + y) >= x == (y >= 0));
}
| /// @notice Returns x + y, reverts if overflows or underflows
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1377,
1504
]
} | 29,519 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LowGasSafeMath | library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @not... | /// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost | NatSpecSingleLine | sub | function sub(int256 x, int256 y) internal pure returns (int256 z) {
require((z = x - y) <= x == (y >= 0));
}
| /// @notice Returns x - y, reverts if overflows or underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1682,
1809
]
} | 29,520 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LowGasSafeMath | library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @not... | /// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost | NatSpecSingleLine | add128 | function add128(uint128 x, uint128 y) internal pure returns (uint128 z) {
require((z = x + y) >= x);
}
| /// @notice Returns x + y, reverts if sum overflows uint128
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1973,
2094
]
} | 29,521 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LowGasSafeMath | library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @not... | /// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost | NatSpecSingleLine | sub128 | function sub128(uint128 x, uint128 y) internal pure returns (uint128 z) {
require((z = x - y) <= x);
}
| /// @notice Returns x - y, reverts if underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2259,
2380
]
} | 29,522 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LowGasSafeMath | library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @not... | /// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost | NatSpecSingleLine | mul128 | function mul128(uint128 x, uint128 y) internal pure returns (uint128 z) {
require(x == 0 || (z = x * y) / x == y);
}
| /// @notice Returns x * y, reverts if overflows
/// @param x The multiplicand
/// @param y The multiplier
/// @return z The product of x and y | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2546,
2681
]
} | 29,523 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LowGasSafeMath | library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @not... | /// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost | NatSpecSingleLine | add160 | function add160(uint160 x, uint160 y) internal pure returns (uint160 z) {
require((z = x + y) >= x);
}
| /// @notice Returns x + y, reverts if sum overflows uint128
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2845,
2966
]
} | 29,524 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LowGasSafeMath | library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @not... | /// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost | NatSpecSingleLine | sub160 | function sub160(uint160 x, uint160 y) internal pure returns (uint160 z) {
require((z = x - y) <= x);
}
| /// @notice Returns x - y, reverts if underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
3131,
3252
]
} | 29,525 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LowGasSafeMath | library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @not... | /// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost | NatSpecSingleLine | mul160 | function mul160(uint160 x, uint160 y) internal pure returns (uint160 z) {
require(x == 0 || (z = x * y) / x == y);
}
| /// @notice Returns x * y, reverts if overflows
/// @param x The multiplicand
/// @param y The multiplier
/// @return z The product of x and y | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
3418,
3553
]
} | 29,526 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SqrtPriceMath | library SqrtPriceMath {
using LowGasSafeMath for uint256;
using SafeCast for uint256;
/// @notice Gets the next sqrt price given a delta of token0
/// @dev Always rounds up, because in the exact output case (increasing price) we need to move the price at least
/// far enough to get the desire... | /// @title Functions based on Q64.96 sqrt price and liquidity
/// @notice Contains the math that uses square root of price as a Q64.96 and liquidity to compute deltas | NatSpecSingleLine | getNextSqrtPriceFromAmount0RoundingUp | function getNextSqrtPriceFromAmount0RoundingUp(
uint160 sqrtPX96,
uint128 liquidity,
uint256 amount,
bool add
) internal pure returns (uint160) {
// we short circuit amount == 0 because the result is otherwise not guaranteed to equal the input price
if (amount == 0) return sqrtPX96;
... | /// @notice Gets the next sqrt price given a delta of token0
/// @dev Always rounds up, because in the exact output case (increasing price) we need to move the price at least
/// far enough to get the desired output amount, and in the exact input case (decreasing price) we need to move the
/// price less in order to no... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1047,
2446
]
} | 29,527 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SqrtPriceMath | library SqrtPriceMath {
using LowGasSafeMath for uint256;
using SafeCast for uint256;
/// @notice Gets the next sqrt price given a delta of token0
/// @dev Always rounds up, because in the exact output case (increasing price) we need to move the price at least
/// far enough to get the desire... | /// @title Functions based on Q64.96 sqrt price and liquidity
/// @notice Contains the math that uses square root of price as a Q64.96 and liquidity to compute deltas | NatSpecSingleLine | getNextSqrtPriceFromAmount1RoundingDown | function getNextSqrtPriceFromAmount1RoundingDown(
uint160 sqrtPX96,
uint128 liquidity,
uint256 amount,
bool add
) internal pure returns (uint160) {
// if we're adding (subtracting), rounding down requires rounding the quotient down (up)
// in both cases, avoid a mulDiv for most inputs
... | /// @notice Gets the next sqrt price given a delta of token1
/// @dev Always rounds down, because in the exact output case (decreasing price) we need to move the price at least
/// far enough to get the desired output amount, and in the exact input case (increasing price) we need to move the
/// price less in order to ... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
3279,
4466
]
} | 29,528 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | TransferHelper | library TransferHelper {
/// @notice Transfers tokens from the targeted address to the given destination
/// @notice Errors with 'STF' if transfer fails
/// @param token The contract address of the token to be transferred
/// @param from The originating address from which the tokens will be transfer... | safeTransferFrom | function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
(bool success, bytes memory data) =
token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))),... | /// @notice Transfers tokens from the targeted address to the given destination
/// @notice Errors with 'STF' if transfer fails
/// @param token The contract address of the token to be transferred
/// @param from The originating address from which the tokens will be transferred
/// @param to The destination address of ... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
435,
807
]
} | 29,529 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | TransferHelper | library TransferHelper {
/// @notice Transfers tokens from the targeted address to the given destination
/// @notice Errors with 'STF' if transfer fails
/// @param token The contract address of the token to be transferred
/// @param from The originating address from which the tokens will be transfer... | safeTransfer | function safeTransfer(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST');
}
| /// @notice Transfers tokens from msg.sender to a recipient
/// @dev Errors with ST if transfer fails
/// @param token The contract address of the token which will be transferred
/// @param to The recipient of the transfer
/// @param value The value of the transfer | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1101,
1422
]
} | 29,530 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | TransferHelper | library TransferHelper {
/// @notice Transfers tokens from the targeted address to the given destination
/// @notice Errors with 'STF' if transfer fails
/// @param token The contract address of the token to be transferred
/// @param from The originating address from which the tokens will be transfer... | safeTransferETH | function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'STE');
}
| /// @notice Transfers ETH to the recipient address
/// @dev Fails with `STE`
/// @param to The destination of the transfer
/// @param value The value to be transferred | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1613,
1786
]
} | 29,531 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IWETH9 | interface IWETH9 is IERC20 {
/// @notice Deposit ether to get wrapped ether
function deposit() external payable;
} | /// @title Interface for WETH9 | NatSpecSingleLine | deposit | function deposit() external payable;
| /// @notice Deposit ether to get wrapped ether | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
82,
123
]
} | 29,532 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | init | function init() external onlyGovernance {
require(!finalized, "F");
finalized = true;
int24 baseThreshold = tickSpacing * ISorbettoStrategy(strategy).tickRangeMultiplier();
( , int24 currentTick, , , , , ) = pool.slot0();
int24 tickFloor = PoolVariables.floor(currentTick, tickSpacing);
... | //initialize strategy | LineComment | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
6165,
6713
]
} | 29,533 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | deposit | function deposit(
uint256 amount0Desired,
uint256 amount1Desired
external
payable
override
nonReentrant
checkDeviation
updateVault(msg.sender)
returns (
uint256 shares,
uint256 amount0,
uint256 amount1
)
require(amount0Desired > 0 && amount1Desired... | /// @inheritdoc ISorbettoFragola | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
6758,
7808
]
} | 29,534 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | withdraw | function withdraw(
uint256 shares
)
external
override
nonReentrant
checkDeviation
updateVault(msg.sender)
returns (
uint256 amount0,
uint256 amount1
)
{
require(shares > 0, "S");
(amount0, amount1) = pool.burnLiquidityShare(tickLower, tickUpper,... | /// @inheritdoc ISorbettoFragola | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
7853,
8410
]
} | 29,535 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | rerange | function rerange() external override nonReentrant checkDeviation updateVault(address(0)) {
//Burn all liquidity from pool to rerange for Sorbetto's balances.
pool.burnAllLiquidity(tickLower, tickUpper);
// Emit snapshot to record balances
uint256 balance0 = _balance0();
uint256 ba... | /// @inheritdoc ISorbettoFragola | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
8455,
9631
]
} | 29,536 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | rebalance | function rebalance() external override onlyGovernance nonReentrant checkDeviation updateVault(address(0)) {
//Burn all liquidity from pool to rerange for Sorbetto's balances.
pool.burnAllLiquidity(tickLower, tickUpper);
//Calc base ticks
(uint160 sqrtPriceX96, int24 currentTick, , , , ,... | /// @inheritdoc ISorbettoFragola | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
9672,
13042
]
} | 29,537 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | _calcShare | function _calcShare(uint128 liquidity, uint128 liquidityLast)
internal
view
returns (
uint256 shares
)
{
shares = totalSupply() == 0 ? uint256(liquidity) : uint256(liquidity).mul(totalSupply()).unsafeDiv(uint256(liquidityLast));
}
| // Calcs user share depending on deposited amounts | LineComment | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
13101,
13404
]
} | 29,538 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | _balance0 | function _balance0() internal view returns (uint256) {
return IERC20(token0).balanceOf(address(this));
}
| /// @dev Amount of token0 held as unused balance. | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
13466,
13589
]
} | 29,539 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | _balance1 | function _balance1() internal view returns (uint256) {
return IERC20(token1).balanceOf(address(this));
}
| /// @dev Amount of token1 held as unused balance. | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
13647,
13770
]
} | 29,540 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | _earnFees | function _earnFees() internal returns (uint256 userCollect0, uint256 userCollect1) {
// Do zero-burns to poke the Uniswap pools so earned fees are updated
pool.burn(tickLower, tickUpper, 0);
(uint256 collect0, uint256 collect1) =
pool.collect(
address(this),
... | /// @dev collects fees from the pool | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
13819,
15030
]
} | 29,541 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | position | function position() external view returns (uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) {
bytes32 positionKey = PositionKey.compute(address(this), tickLower, tickUpper);
(liquidity, feeGrowthInside0LastX128, feeGrowthInside1La... | /// @notice Returns current Sorbetto's position in pool | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
15094,
15498
]
} | 29,542 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | uniswapV3MintCallback | function uniswapV3MintCallback(
uint256 amount0,
uint256 amount1,
bytes calldata data
) external {
require(msg.sender == address(pool), "FP");
MintCallbackData memory decoded = abi.decode(data, (MintCallbackData));
if (amount0 > 0) pay(token0, decoded.payer, msg.sender, amount0);
if ... | /// @notice Pull in tokens from sender. Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.
/// @dev In the implementation you must pay to the pool for the minted liquidity.
/// @param amount0 The amount of token0 due to the pool for the minted liquidity
/// @param amount1 The amount ... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
15995,
16421
]
} | 29,543 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | uniswapV3SwapCallback | function uniswapV3SwapCallback(
int256 amount0,
int256 amount1,
bytes calldata _data
) external {
require(msg.sender == address(pool), "FP");
require(amount0 > 0 || amount1 > 0); // swaps entirely within 0-liquidity regions are not supported
SwapCallbackData memory data = abi.decode(_data... | /// @notice Called to `msg.sender` after minting swaping from IUniswapV3Pool#swap.
/// @dev In the implementation you must pay to the pool for swap.
/// @param amount0 The amount of token0 due to the pool for the swap
/// @param amount1 The amount of token1 due to the pool for the swap
/// @param _data Any data passed ... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
16831,
17415
]
} | 29,544 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | pay | function pay(
address token,
address payer,
address recipient,
uint256 value
) internal {
if (token == weth && address(this).balance >= value) {
// pay with WETH9
IWETH9(weth).deposit{value: value}(); // wrap only what is needed to pay
IWETH9(weth).transfer(recipient... | /// @param token The token to pay
/// @param payer The entity that must pay
/// @param recipient The entity that will receive payment
/// @param value The amount to pay | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
17607,
18325
]
} | 29,545 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | collectProtocolFees | function collectProtocolFees(
uint256 amount0,
uint256 amount1
) external nonReentrant onlyGovernance updateVault(address(0)) {
require(accruedProtocolFees0 >= amount0, "A0F");
require(accruedProtocolFees1 >= amount1, "A1F");
uint256 balance0 = _balance0();
uint256 balance1 = _b... | /**
* @notice Used to withdraw accumulated protocol fees.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
18416,
19461
]
} | 29,546 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | collectFees | function collectFees(uint256 amount0, uint256 amount1) external nonReentrant updateVault(msg.sender) {
UserInfo storage user = userInfo[msg.sender];
require(user.token0Rewards >= amount0, "A0R");
require(user.token1Rewards >= amount1, "A1R");
uint256 balance0 = _balance0();
uint256 balance1... | /**
* @notice Used to withdraw accumulated user's fees.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
19544,
20569
]
} | 29,547 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | _updateFeesReward | function _updateFeesReward(address account) internal {
uint liquidity = pool.positionLiquidity(tickLower, tickUpper);
if (liquidity == 0) return; // we can't poke when liquidity is zero
(uint256 collect0, uint256 collect1) = _earnFees();
token0PerShareStored = _tokenPerShare(coll... | // Updates user's fees reward | LineComment | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
21160,
22018
]
} | 29,548 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | _fee0Earned | function _fee0Earned(address account, uint256 fee0PerShare_) internal view returns (uint256) {
UserInfo memory user = userInfo[account];
return
balanceOf(account)
.mul(fee0PerShare_.sub(user.token0PerSharePaid))
.unsafeDiv(1e18)
.add(user.token0Rewards);
}
| // Calculates how much token0 is entitled for a particular user | LineComment | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
22094,
22430
]
} | 29,549 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | _fee1Earned | function _fee1Earned(address account, uint256 fee1PerShare_) internal view returns (uint256) {
UserInfo memory user = userInfo[account];
return
balanceOf(account)
.mul(fee1PerShare_.sub(user.token1PerSharePaid))
.unsafeDiv(1e18)
.add(user.token1Rewards);
}
| // Calculates how much token1 is entitled for a particular user | LineComment | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
22506,
22842
]
} | 29,550 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | _tokenPerShare | function _tokenPerShare(uint256 collected, uint256 tokenPerShareStored) internal view returns (uint256) {
uint _totalSupply = totalSupply();
if (_totalSupply > 0) {
return tokenPerShareStored
.add(
collected
.mul(1e18)
.unsafeDiv(_totalSupply)
... | // Calculates how much token is provided per LP token | LineComment | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
22909,
23323
]
} | 29,551 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | refundETH | function refundETH() internal {
if (address(this).balance > 0) TransferHelper.safeTransferETH(msg.sender, address(this).balance);
}
| /// @notice Refunds any ETH balance held by this contract to the `msg.sender`
/// @dev Useful for bundling with mint or increase liquidity that uses ether, or exact output swaps
/// that use ether for the input amount | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
23563,
23713
]
} | 29,552 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | setGovernance | function setGovernance(address _governance) external onlyGovernance {
pendingGovernance = _governance;
}
| /**
* @notice `setGovernance()` should be called by the existing governance
* address prior to calling this function.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
23860,
23983
]
} | 29,553 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | acceptGovernance | function acceptGovernance() external {
require(msg.sender == pendingGovernance, "PG");
emit TransferGovernance(governance, pendingGovernance);
pendingGovernance = address(0);
governance = msg.sender;
}
| /**
* @notice Governance address is not updated until the new governance
* address has called `acceptGovernance()` to accept this responsibility.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
24158,
24405
]
} | 29,554 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | SorbettoFragola | contract SorbettoFragola is ERC20Permit, ReentrancyGuard, ISorbettoFragola {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint160;
using LowGasSafeMath for uint128;
using UnsafeMath for uint256;
using SafeCast for uint256;
using PoolVariables for IUniswapV3Pool;
using Po... | /// @title Sorbetto Fragola is a yield enchancement v3 contract
/// @dev Sorbetto fragola is a Uniswap V3 yield enchancement contract which acts as
/// intermediary between the user who wants to provide liquidity to specific pools
/// and earn fees from such actions. The contract ensures that user position is in
/// r... | NatSpecSingleLine | setStrategy | function setStrategy(address _strategy) external onlyGovernance {
require(_strategy != address(0), "NA");
strategy = _strategy;
}
| // Sets new strategy contract address for new settings | LineComment | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
24468,
24625
]
} | 29,555 |
BoostPax | BoostPax.sol | 0x340085ed7d6c18dcf4c8b661fba6bd95916c8644 | Solidity | BoostPax | contract BoostPax {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappi... | _transfer | function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0x0));
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanc... | /**
* Internal transfer, only can be called by this contract
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://e7251068c5ebd35d64709d1d6929983b318ac17c049fb22827676fd1bbf99509 | {
"func_code_index": [
1649,
2522
]
} | 29,556 | |||
BoostPax | BoostPax.sol | 0x340085ed7d6c18dcf4c8b661fba6bd95916c8644 | Solidity | BoostPax | contract BoostPax {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappi... | transfer | function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
| /**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://e7251068c5ebd35d64709d1d6929983b318ac17c049fb22827676fd1bbf99509 | {
"func_code_index": [
2739,
2900
]
} | 29,557 | |||
BoostPax | BoostPax.sol | 0x340085ed7d6c18dcf4c8b661fba6bd95916c8644 | Solidity | BoostPax | contract BoostPax {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappi... | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
| /**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://e7251068c5ebd35d64709d1d6929983b318ac17c049fb22827676fd1bbf99509 | {
"func_code_index": [
3187,
3494
]
} | 29,558 | |||
BoostPax | BoostPax.sol | 0x340085ed7d6c18dcf4c8b661fba6bd95916c8644 | Solidity | BoostPax | contract BoostPax {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappi... | approve | function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| /**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://e7251068c5ebd35d64709d1d6929983b318ac17c049fb22827676fd1bbf99509 | {
"func_code_index": [
3769,
4005
]
} | 29,559 | |||
BoostPax | BoostPax.sol | 0x340085ed7d6c18dcf4c8b661fba6bd95916c8644 | Solidity | BoostPax | contract BoostPax {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappi... | approveAndCall | function approveAndCall(address _spender, uint256 _value, bytes memory _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, address(this), _extraData);
return true... | /**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @pa... | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://e7251068c5ebd35d64709d1d6929983b318ac17c049fb22827676fd1bbf99509 | {
"func_code_index": [
4411,
4788
]
} | 29,560 | |||
BoostPax | BoostPax.sol | 0x340085ed7d6c18dcf4c8b661fba6bd95916c8644 | Solidity | BoostPax | contract BoostPax {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappi... | burn | function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
emit Burn(msg.sender,... | /**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://e7251068c5ebd35d64709d1d6929983b318ac17c049fb22827676fd1bbf99509 | {
"func_code_index": [
4968,
5354
]
} | 29,561 | |||
BoostPax | BoostPax.sol | 0x340085ed7d6c18dcf4c8b661fba6bd95916c8644 | Solidity | BoostPax | contract BoostPax {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappi... | burnFrom | function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Sub... | /**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://e7251068c5ebd35d64709d1d6929983b318ac17c049fb22827676fd1bbf99509 | {
"func_code_index": [
5621,
6246
]
} | 29,562 | |||
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
... | /**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/ | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
| /**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
104,
320
]
} | 29,563 |
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
... | /**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
return c;
}
| /**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/ | NatSpecMultiLine | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
448,
600
]
} | 29,564 |
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
... | /**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
| /**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
731,
884
]
} | 29,565 |
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
... | /**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
| /**
* @dev Adds two unsigned integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
965,
1118
]
} | 29,566 |
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
... | /**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/ | NatSpecMultiLine | mod | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
| /**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/ | NatSpecMultiLine | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
1271,
1400
]
} | 29,567 |
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | BaseToken | contract BaseToken is Ownable
{
using SafeMath for uint256;
uint256 constant internal E18 = 1000000000000000000;
uint256 constant public decimals = 18;
uint256 public totalSupply;
struct Lock {
uint256 amount;
uint256 expiresAt;
}
mapping (address => uint256) ... | transferWithLock | function transferWithLock(address _to, uint256 _value, uint256 _time) onlyOwner transferParamsValidation(msg.sender, _to, _value) external returns (bool)
{
require(_time > now);
_lock(_to, _value, _time);
_transfer(msg.sender, _to, _value);
return true;
}
| // transferWithLock is only for airdrop or marketing purpose | LineComment | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
3449,
3759
]
} | 29,568 | ||
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | BaseToken | contract BaseToken is Ownable
{
using SafeMath for uint256;
uint256 constant internal E18 = 1000000000000000000;
uint256 constant public decimals = 18;
uint256 public totalSupply;
struct Lock {
uint256 amount;
uint256 expiresAt;
}
mapping (address => uint256) ... | lockAddress | function lockAddress(address _addr, bool _locked) onlyOwner external
{
lockedAddresses[_addr] = _locked;
}
| // lockAddress is only for security accident prevention | LineComment | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
3833,
3963
]
} | 29,569 | ||
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | BaseToken | contract BaseToken is Ownable
{
using SafeMath for uint256;
uint256 constant internal E18 = 1000000000000000000;
uint256 constant public decimals = 18;
uint256 public totalSupply;
struct Lock {
uint256 amount;
uint256 expiresAt;
}
mapping (address => uint256) ... | approve | function approve(address _spender, uint256 _value) external onlyWhenNotStopped returns (bool)
{
require(_spender != address(0));
require(balances[msg.sender] >= _value);
require(msg.sender != _spender);
approvals[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
... | // approve is for transfer authentication | LineComment | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
4013,
4392
]
} | 29,570 | ||
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | BaseToken | contract BaseToken is Ownable
{
using SafeMath for uint256;
uint256 constant internal E18 = 1000000000000000000;
uint256 constant public decimals = 18;
uint256 public totalSupply;
struct Lock {
uint256 amount;
uint256 expiresAt;
}
mapping (address => uint256) ... | burn | function burn(uint256 _value) external
{
require(balances[msg.sender] >= _value);
require(_value > 0);
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(msg.sender, _value);
}
| // burn is for incubator fund or security accident prevention | LineComment | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
5038,
5335
]
} | 29,571 | ||
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | BaseToken | contract BaseToken is Ownable
{
using SafeMath for uint256;
uint256 constant internal E18 = 1000000000000000000;
uint256 constant public decimals = 18;
uint256 public totalSupply;
struct Lock {
uint256 amount;
uint256 expiresAt;
}
mapping (address => uint256) ... | destruction | function destruction() onlyOwner public
{
selfdestruct(msg.sender);
}
| // destruction is for token upgrade | LineComment | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
6156,
6249
]
} | 29,572 | ||
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | Roles | library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.beare... | /**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/ | NatSpecMultiLine | add | function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.bearer[account] = true;
}
| /**
* @dev give an account access to this role
*/ | NatSpecMultiLine | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
155,
346
]
} | 29,573 |
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | Roles | library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.beare... | /**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/ | NatSpecMultiLine | remove | function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));
role.bearer[account] = false;
}
| /**
* @dev remove an account's access to this role
*/ | NatSpecMultiLine | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
420,
614
]
} | 29,574 |
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | Roles | library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.beare... | /**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/ | NatSpecMultiLine | has | function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0));
return role.bearer[account];
}
| /**
* @dev check if an account has this role
* @return bool
*/ | NatSpecMultiLine | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
703,
873
]
} | 29,575 |
THECASH | THECASH.sol | 0xcd475371e39c0d94e82fccc9dd0ea710d0dc0c0b | Solidity | ERC20Mintable | contract ERC20Mintable is BaseToken, MinterRole {
/**
* @dev Function to mint tokens
* @param to The address that will receive the minted tokens.
* @param value The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
// mint is ... | /**
* @title ERC20Mintable
* @dev ERC20 minting logic
*/ | NatSpecMultiLine | mint | function mint(address to, uint256 value) public onlyMinter returns (bool) {
_mint(to, value);
return true;
}
| // mint is only for THENODE's daily MPoS mining (250000 THE) | LineComment | v0.5.8+commit.23d335f2 | Unlicense | bzzr://688b05cb3c4681d686ce82fee718db6c6e213555845319fdc6df353d40f2550b | {
"func_code_index": [
371,
507
]
} | 29,576 |
PledgeDeposit | @openzeppelin/contracts/token/ERC20/SafeERC20.sol | 0x4ecfdbb79b14651a44d6444c4033ad7625692e1a | Solidity | SafeERC20 | library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, add... | /**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `... | NatSpecMultiLine | safeApprove | function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line ... | /**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | GNU LGPLv3 | ipfs://3ba90513d93a77a09ec292bf9648a5bf25ecefd07c238d3d6eb60d4f1400c067 | {
"func_code_index": [
747,
1374
]
} | 29,577 |
PledgeDeposit | @openzeppelin/contracts/token/ERC20/SafeERC20.sol | 0x4ecfdbb79b14651a44d6444c4033ad7625692e1a | Solidity | SafeERC20 | library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, add... | /**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `... | NatSpecMultiLine | _callOptionalReturn | function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target ad... | /**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi... | NatSpecMultiLine | v0.6.12+commit.27d51765 | GNU LGPLv3 | ipfs://3ba90513d93a77a09ec292bf9648a5bf25ecefd07c238d3d6eb60d4f1400c067 | {
"func_code_index": [
2393,
3159
]
} | 29,578 |
trustedChildWithdraw | trustedChildWithdraw.sol | 0x111cc94a5dabdf192c5106fadc844a98b0f56be0 | Solidity | trustedChildWithdraw | contract trustedChildWithdraw {
DAO constant public mainDAO = DAO(0xbb9bc244d798123fde783fcc1c72d3bb8c189413);
uint[] public trustedProposals = [7, 10, 16, 20, 23, 26, 27, 28, 31, 34, 37, 39, 41, 44, 54, 57, 60, 61, 63, 64, 65, 66];
mapping (uint => DAO) public whiteList;
address constant curator = 0xda4a... | /**
* @title trustedChildWithdraw
* @author Paul Szczesny, Alexey Akhunov
* A simple withdraw contract for trusted childDAOs affected by the hard fork.
* Based on the official WithdrawDAO contract found here: https://etherscan.io/address/0xbf4ed7b27f1d666546e30d74d50d173d20bca754#code
*/ | NatSpecMultiLine | trustedChildWithdraw | function trustedChildWithdraw() {
for(uint i=0; i<trustedProposals.length; i++) {
uint proposalId = trustedProposals[i];
whiteList[proposalId] = DAO(mainDAO.getNewDAOAddress(proposalId));
}
}
| /**
* Populates the whiteList based on the list of trusted proposal Ids.
*/ | NatSpecMultiLine | v0.3.6-2016-08-17-c499470 | {
"func_code_index": [
446,
679
]
} | 29,579 | ||
trustedChildWithdraw | trustedChildWithdraw.sol | 0x111cc94a5dabdf192c5106fadc844a98b0f56be0 | Solidity | trustedChildWithdraw | contract trustedChildWithdraw {
DAO constant public mainDAO = DAO(0xbb9bc244d798123fde783fcc1c72d3bb8c189413);
uint[] public trustedProposals = [7, 10, 16, 20, 23, 26, 27, 28, 31, 34, 37, 39, 41, 44, 54, 57, 60, 61, 63, 64, 65, 66];
mapping (uint => DAO) public whiteList;
address constant curator = 0xda4a... | /**
* @title trustedChildWithdraw
* @author Paul Szczesny, Alexey Akhunov
* A simple withdraw contract for trusted childDAOs affected by the hard fork.
* Based on the official WithdrawDAO contract found here: https://etherscan.io/address/0xbf4ed7b27f1d666546e30d74d50d173d20bca754#code
*/ | NatSpecMultiLine | requiredEndowment | function requiredEndowment() constant returns (uint endowment) {
uint sum = 0;
for(uint i=0; i<trustedProposals.length; i++) {
uint proposalId = trustedProposals[i];
DAO childDAO = whiteList[proposalId];
sum += childDAO.totalSupply();
}
return sum;
}
| /**
* Convienience function for the Curator to calculate the required amount of Wei
* that needs to be transferred to this contract.
*/ | NatSpecMultiLine | v0.3.6-2016-08-17-c499470 | {
"func_code_index": [
830,
1147
]
} | 29,580 | ||
trustedChildWithdraw | trustedChildWithdraw.sol | 0x111cc94a5dabdf192c5106fadc844a98b0f56be0 | Solidity | trustedChildWithdraw | contract trustedChildWithdraw {
DAO constant public mainDAO = DAO(0xbb9bc244d798123fde783fcc1c72d3bb8c189413);
uint[] public trustedProposals = [7, 10, 16, 20, 23, 26, 27, 28, 31, 34, 37, 39, 41, 44, 54, 57, 60, 61, 63, 64, 65, 66];
mapping (uint => DAO) public whiteList;
address constant curator = 0xda4a... | /**
* @title trustedChildWithdraw
* @author Paul Szczesny, Alexey Akhunov
* A simple withdraw contract for trusted childDAOs affected by the hard fork.
* Based on the official WithdrawDAO contract found here: https://etherscan.io/address/0xbf4ed7b27f1d666546e30d74d50d173d20bca754#code
*/ | NatSpecMultiLine | withdraw | function withdraw(uint proposalId) external {
//Check the token balance
uint balance = whiteList[proposalId].balanceOf(msg.sender);
// Transfer childDao tokens first, then send Ether back in return
if (!whiteList[proposalId].transferFrom(msg.sender, this, balance) || !msg.sender.send(balance))
throw;... | /**
* Function call to withdraw ETH by burning childDao tokens.
* @param proposalId The split proposal ID which created the childDao
* @dev This requires that the token-holder authorizes this contract's address using the approve() function.
*/ | NatSpecMultiLine | v0.3.6-2016-08-17-c499470 | {
"func_code_index": [
1413,
1751
]
} | 29,581 | ||
trustedChildWithdraw | trustedChildWithdraw.sol | 0x111cc94a5dabdf192c5106fadc844a98b0f56be0 | Solidity | trustedChildWithdraw | contract trustedChildWithdraw {
DAO constant public mainDAO = DAO(0xbb9bc244d798123fde783fcc1c72d3bb8c189413);
uint[] public trustedProposals = [7, 10, 16, 20, 23, 26, 27, 28, 31, 34, 37, 39, 41, 44, 54, 57, 60, 61, 63, 64, 65, 66];
mapping (uint => DAO) public whiteList;
address constant curator = 0xda4a... | /**
* @title trustedChildWithdraw
* @author Paul Szczesny, Alexey Akhunov
* A simple withdraw contract for trusted childDAOs affected by the hard fork.
* Based on the official WithdrawDAO contract found here: https://etherscan.io/address/0xbf4ed7b27f1d666546e30d74d50d173d20bca754#code
*/ | NatSpecMultiLine | clawback | function clawback() external {
if (msg.sender != curator) throw;
if (!curator.send(this.balance)) throw;
}
| /**
* Return funds back to the curator.
*/ | NatSpecMultiLine | v0.3.6-2016-08-17-c499470 | {
"func_code_index": [
1808,
1930
]
} | 29,582 | ||
FxsAccumulator | contracts/accumulator/BaseAccumulator.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | BaseAccumulator | contract BaseAccumulator {
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address public governance;
address public locker;
address public tokenReward;
address public gauge;
/* ========== EVENTS ========== */
event GaugeSet(address oldGauge, address newGauge);
... | /// @title A contract that defines the functions shared by all accumulators
/// @author StakeDAO | NatSpecSingleLine | notifyExtraReward | function notifyExtraReward(address _tokenReward, uint256 _amount) external {
require(msg.sender == governance, "!gov");
_notifyReward(_tokenReward, _amount);
}
| /// @notice Notify the reward using an extra token
/// @param _tokenReward token address to notify
/// @param _amount amount to notify | NatSpecSingleLine | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
1041,
1224
]
} | 29,583 | |
FxsAccumulator | contracts/accumulator/BaseAccumulator.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | BaseAccumulator | contract BaseAccumulator {
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address public governance;
address public locker;
address public tokenReward;
address public gauge;
/* ========== EVENTS ========== */
event GaugeSet(address oldGauge, address newGauge);
... | /// @title A contract that defines the functions shared by all accumulators
/// @author StakeDAO | NatSpecSingleLine | notifyAllExtraReward | function notifyAllExtraReward(address _tokenReward) external {
require(msg.sender == governance, "!gov");
uint256 amount = IERC20(_tokenReward).balanceOf(address(this));
_notifyReward(_tokenReward, amount);
}
| /// @notice Notify the reward using all balance of extra token
/// @param _tokenReward token address to notify | NatSpecSingleLine | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
1345,
1585
]
} | 29,584 | |
FxsAccumulator | contracts/accumulator/BaseAccumulator.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | BaseAccumulator | contract BaseAccumulator {
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address public governance;
address public locker;
address public tokenReward;
address public gauge;
/* ========== EVENTS ========== */
event GaugeSet(address oldGauge, address newGauge);
... | /// @title A contract that defines the functions shared by all accumulators
/// @author StakeDAO | NatSpecSingleLine | _notifyReward | function _notifyReward(address _tokenReward, uint256 _amount) internal {
require(gauge != address(0), "gauge not set");
require(_amount > 0, "set an amount > 0");
uint256 balanceBefore = IERC20(_tokenReward).balanceOf(address(this));
require(balanceBefore >= _amount, "amount not enough");
if (ILiqui... | /// @notice Notify the new reward to the LGV4
/// @param _tokenReward token to notify
/// @param _amount amount to notify | NatSpecSingleLine | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
1721,
2522
]
} | 29,585 | |
FxsAccumulator | contracts/accumulator/BaseAccumulator.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | BaseAccumulator | contract BaseAccumulator {
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address public governance;
address public locker;
address public tokenReward;
address public gauge;
/* ========== EVENTS ========== */
event GaugeSet(address oldGauge, address newGauge);
... | /// @title A contract that defines the functions shared by all accumulators
/// @author StakeDAO | NatSpecSingleLine | depositToken | function depositToken(address _token, uint256 _amount) external {
require(_amount > 0, "set an amount > 0");
IERC20(_token).safeTransferFrom(msg.sender, address(this), _amount);
emit TokenDeposited(_token, _amount);
}
| /// @notice Deposit token into the accumulator
/// @param _token token to deposit
/// @param _amount amount to deposit | NatSpecSingleLine | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
2655,
2904
]
} | 29,586 | |
FxsAccumulator | contracts/accumulator/BaseAccumulator.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | BaseAccumulator | contract BaseAccumulator {
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address public governance;
address public locker;
address public tokenReward;
address public gauge;
/* ========== EVENTS ========== */
event GaugeSet(address oldGauge, address newGauge);
... | /// @title A contract that defines the functions shared by all accumulators
/// @author StakeDAO | NatSpecSingleLine | setGauge | function setGauge(address _gauge) external {
require(msg.sender == governance, "!gov");
require(_gauge != address(0), "can't be zero address");
emit GaugeSet(gauge, _gauge);
gauge = _gauge;
}
| /// @notice Sets gauge for the accumulator which will receive and distribute the rewards
/// @dev Can be called only by the governance
/// @param _gauge gauge address | NatSpecSingleLine | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
3086,
3317
]
} | 29,587 | |
FxsAccumulator | contracts/accumulator/BaseAccumulator.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | BaseAccumulator | contract BaseAccumulator {
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address public governance;
address public locker;
address public tokenReward;
address public gauge;
/* ========== EVENTS ========== */
event GaugeSet(address oldGauge, address newGauge);
... | /// @title A contract that defines the functions shared by all accumulators
/// @author StakeDAO | NatSpecSingleLine | setGovernance | function setGovernance(address _governance) external {
require(msg.sender == governance, "!gov");
require(_governance != address(0), "can't be zero address");
emit GovernanceSet(governance, _governance);
governance = _governance;
}
| /// @notice Allows the governance to set the new governance
/// @dev Can be called only by the governance
/// @param _governance governance address | NatSpecSingleLine | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
3480,
3751
]
} | 29,588 | |
FxsAccumulator | contracts/accumulator/BaseAccumulator.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | BaseAccumulator | contract BaseAccumulator {
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address public governance;
address public locker;
address public tokenReward;
address public gauge;
/* ========== EVENTS ========== */
event GaugeSet(address oldGauge, address newGauge);
... | /// @title A contract that defines the functions shared by all accumulators
/// @author StakeDAO | NatSpecSingleLine | setLocker | function setLocker(address _locker) external {
require(msg.sender == governance, "!gov");
require(_locker != address(0), "can't be zero address");
emit LockerSet(locker, _locker);
locker = _locker;
}
| /// @notice Allows the governance to set the locker
/// @dev Can be called only by the governance
/// @param _locker locker address | NatSpecSingleLine | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
3898,
4137
]
} | 29,589 | |
FxsAccumulator | contracts/accumulator/BaseAccumulator.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | BaseAccumulator | contract BaseAccumulator {
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address public governance;
address public locker;
address public tokenReward;
address public gauge;
/* ========== EVENTS ========== */
event GaugeSet(address oldGauge, address newGauge);
... | /// @title A contract that defines the functions shared by all accumulators
/// @author StakeDAO | NatSpecSingleLine | setTokenReward | function setTokenReward(address _tokenReward) external {
require(msg.sender == governance, "!gov");
require(_tokenReward != address(0), "can't be zero address");
emit TokenRewardSet(tokenReward, _tokenReward);
tokenReward = _tokenReward;
}
| /// @notice Allows the governance to set the token reward
/// @dev Can be called only by the governance
/// @param _tokenReward token reward address | NatSpecSingleLine | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
4301,
4580
]
} | 29,590 | |
FxsAccumulator | contracts/accumulator/BaseAccumulator.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | BaseAccumulator | contract BaseAccumulator {
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address public governance;
address public locker;
address public tokenReward;
address public gauge;
/* ========== EVENTS ========== */
event GaugeSet(address oldGauge, address newGauge);
... | /// @title A contract that defines the functions shared by all accumulators
/// @author StakeDAO | NatSpecSingleLine | rescueERC20 | function rescueERC20(
address _token,
uint256 _amount,
address _recipient
) external {
require(msg.sender == governance, "!gov");
require(_amount > 0, "set an amount > 0");
require(_recipient != address(0), "can't be zero address");
IERC20(_token).safeTransfer(_recipient, _amount);
emit ERC20Rescued... | /// @notice A function that rescue any ERC20 token
/// @param _token token address
/// @param _amount amount to rescue
/// @param _recipient address to send token rescued | NatSpecSingleLine | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
4761,
5112
]
} | 29,591 | |
NonFungibleSmilebyTrippie2022 | ERC2000000.sol | 0xf61510d3ff3fdecf18663824cd12f4ab43c3bd03 | 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) priva... | 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.7+commit.e28d00a7 | MIT | ipfs://29dedbf78761364959ffa20dea64484f6930b1cedaa8c5190c7dc1b4ae95ce5a | {
"func_code_index": [
725,
1085
]
} | 29,592 | ||
NonFungibleSmilebyTrippie2022 | ERC2000000.sol | 0xf61510d3ff3fdecf18663824cd12f4ab43c3bd03 | 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) priva... | balanceOf | function balanceOf(address owner)
public
view
virtual
override
returns (uint)
{
require(owner != address(0), "ERC721: balance query for the zero address");
uint count;
uint length= _owners.length;
for( uint i; i < length; ++i ){
if( owner == _owners[i] )
... | /**
* @dev See {IERC721-balanceOf}.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | MIT | ipfs://29dedbf78761364959ffa20dea64484f6930b1cedaa8c5190c7dc1b4ae95ce5a | {
"func_code_index": [
1144,
1595
]
} | 29,593 | ||
NonFungibleSmilebyTrippie2022 | ERC2000000.sol | 0xf61510d3ff3fdecf18663824cd12f4ab43c3bd03 | 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) priva... | 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.7+commit.e28d00a7 | MIT | ipfs://29dedbf78761364959ffa20dea64484f6930b1cedaa8c5190c7dc1b4ae95ce5a | {
"func_code_index": [
1652,
1983
]
} | 29,594 | ||
NonFungibleSmilebyTrippie2022 | ERC2000000.sol | 0xf61510d3ff3fdecf18663824cd12f4ab43c3bd03 | 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) priva... | name | function name() public view virtual override returns (string memory) {
return _name;
}
| /**
* @dev See {IERC721Metadata-name}.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | MIT | ipfs://29dedbf78761364959ffa20dea64484f6930b1cedaa8c5190c7dc1b4ae95ce5a | {
"func_code_index": [
2045,
2150
]
} | 29,595 | ||
NonFungibleSmilebyTrippie2022 | ERC2000000.sol | 0xf61510d3ff3fdecf18663824cd12f4ab43c3bd03 | 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) priva... | symbol | function symbol() public view virtual override returns (string memory) {
return _symbol;
}
| /**
* @dev See {IERC721Metadata-symbol}.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | MIT | ipfs://29dedbf78761364959ffa20dea64484f6930b1cedaa8c5190c7dc1b4ae95ce5a | {
"func_code_index": [
2214,
2323
]
} | 29,596 | ||
NonFungibleSmilebyTrippie2022 | ERC2000000.sol | 0xf61510d3ff3fdecf18663824cd12f4ab43c3bd03 | 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) priva... | 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... | /**
* @dev See {IERC721-approve}.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | MIT | ipfs://29dedbf78761364959ffa20dea64484f6930b1cedaa8c5190c7dc1b4ae95ce5a | {
"func_code_index": [
2380,
2796
]
} | 29,597 | ||
NonFungibleSmilebyTrippie2022 | ERC2000000.sol | 0xf61510d3ff3fdecf18663824cd12f4ab43c3bd03 | 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) priva... | 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.7+commit.e28d00a7 | MIT | ipfs://29dedbf78761364959ffa20dea64484f6930b1cedaa8c5190c7dc1b4ae95ce5a | {
"func_code_index": [
2857,
3170
]
} | 29,598 | ||
NonFungibleSmilebyTrippie2022 | ERC2000000.sol | 0xf61510d3ff3fdecf18663824cd12f4ab43c3bd03 | 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) priva... | 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.7+commit.e28d00a7 | MIT | ipfs://29dedbf78761364959ffa20dea64484f6930b1cedaa8c5190c7dc1b4ae95ce5a | {
"func_code_index": [
3237,
3569
]
} | 29,599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.