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
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 723, 864 ] }
10,700
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 1162, 1359 ] }
10,701
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 1613, 2089 ] }
10,702
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to reve...
NatSpecMultiLine
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 2560, 2697 ] }
10,703
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an in...
NatSpecMultiLine
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 3188, 3471 ] }
10,704
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consumi...
NatSpecMultiLine
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 3931, 4066 ] }
10,705
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcod...
NatSpecMultiLine
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 4546, 4717 ] }
10,706
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
isContract
function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly ...
/** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: ...
NatSpecMultiLine
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 606, 1033 ] }
10,707
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
sendValue
function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: u...
/** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `tr...
NatSpecMultiLine
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 1963, 2362 ] }
10,708
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); }
/** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw ...
NatSpecMultiLine
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 3118, 3296 ] }
10,709
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 3521, 3722 ] }
10,710
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ *...
NatSpecMultiLine
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 4092, 4323 ] }
10,711
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); }
/** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 4574, 4895 ] }
10,712
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
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.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 747, 1374 ] }
10,713
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
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.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 2393, 3159 ] }
10,714
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
FixedPoint
library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint _x; } uint8 private constant RESOLUTION = 112; uint private consta...
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
LineComment
encode
function encode(uint112 x) internal pure returns (uq112x112 memory) { return uq112x112(uint224(x) << RESOLUTION); }
// encode a uint112 as a UQ112x112
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 450, 584 ] }
10,715
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
FixedPoint
library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint _x; } uint8 private constant RESOLUTION = 112; uint private consta...
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
LineComment
encode144
function encode144(uint144 x) internal pure returns (uq144x112 memory) { return uq144x112(uint256(x) << RESOLUTION); }
// encodes a uint144 as a UQ144x112
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 628, 765 ] }
10,716
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
FixedPoint
library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint _x; } uint8 private constant RESOLUTION = 112; uint private consta...
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
LineComment
div
function div(uq112x112 memory self, uint112 x) internal pure returns (uq112x112 memory) { require(x != 0, 'FixedPoint: DIV_BY_ZERO'); return uq112x112(self._x / uint224(x)); }
// divide a UQ112x112 by a uint112, returning a UQ112x112
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 831, 1034 ] }
10,717
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
FixedPoint
library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint _x; } uint8 private constant RESOLUTION = 112; uint private consta...
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
LineComment
mul
function mul(uq112x112 memory self, uint y) internal pure returns (uq144x112 memory) { uint z; require(y == 0 || (z = uint(self._x) * y) / y == uint(self._x), "FixedPoint: MULTIPLICATION_OVERFLOW"); return uq144x112(z); }
// multiply a UQ112x112 by a uint, returning a UQ144x112 // reverts on overflow
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 1127, 1385 ] }
10,718
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
FixedPoint
library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint _x; } uint8 private constant RESOLUTION = 112; uint private consta...
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
LineComment
fraction
function fraction(uint112 numerator, uint112 denominator) internal pure returns (uq112x112 memory) { require(denominator > 0, "FixedPoint: DIV_BY_ZERO"); return uq112x112((uint224(numerator) << RESOLUTION) / denominator); }
// returns a UQ112x112 which represents the ratio of the numerator to the denominator // equivalent to encode(numerator).div(denominator)
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 1536, 1787 ] }
10,719
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
FixedPoint
library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint _x; } uint8 private constant RESOLUTION = 112; uint private consta...
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
LineComment
decode
function decode(uq112x112 memory self) internal pure returns (uint112) { return uint112(self._x >> RESOLUTION); }
// decode a UQ112x112 into a uint112 by truncating after the radix point
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 1868, 2000 ] }
10,720
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
FixedPoint
library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint _x; } uint8 private constant RESOLUTION = 112; uint private consta...
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
LineComment
decode144
function decode144(uq144x112 memory self) internal pure returns (uint144) { return uint144(self._x >> RESOLUTION); }
// decode a UQ144x112 into a uint144 by truncating after the radix point
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 2081, 2216 ] }
10,721
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
FixedPoint
library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint _x; } uint8 private constant RESOLUTION = 112; uint private consta...
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
LineComment
reciprocal
function reciprocal(uq112x112 memory self) internal pure returns (uq112x112 memory) { require(self._x != 0, 'FixedPoint: ZERO_RECIPROCAL'); return uq112x112(uint224(Q224 / self._x)); }
// take the reciprocal of a UQ112x112
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 2262, 2474 ] }
10,722
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
FixedPoint
library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint _x; } uint8 private constant RESOLUTION = 112; uint private consta...
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
LineComment
sqrt
function sqrt(uq112x112 memory self) internal pure returns (uq112x112 memory) { return uq112x112(uint224(Babylonian.sqrt(uint256(self._x)) << 56)); }
// square root of a UQ112x112
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 2512, 2680 ] }
10,723
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
UniswapV2OracleLibrary
library UniswapV2OracleLibrary { using FixedPoint for *; // helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1] function currentBlockTimestamp() internal view returns (uint32) { return uint32(block.timestamp % 2 ** 32); } // prod...
// library with helper methods for oracles that are concerned with computing average prices
LineComment
currentBlockTimestamp
function currentBlockTimestamp() internal view returns (uint32) { return uint32(block.timestamp % 2 ** 32); }
// helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1]
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 178, 306 ] }
10,724
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
UniswapV2OracleLibrary
library UniswapV2OracleLibrary { using FixedPoint for *; // helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1] function currentBlockTimestamp() internal view returns (uint32) { return uint32(block.timestamp % 2 ** 32); } // prod...
// library with helper methods for oracles that are concerned with computing average prices
LineComment
currentCumulativePrices
function currentCumulativePrices( address pair, bool isToken0 ) internal view returns (uint priceCumulative, uint32 blockTimestamp) { blockTimestamp = currentBlockTimestamp(); (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = UniswapPair(pair).getReserves(); if (isToken0) { ...
// produces the cumulative price using counterfactuals to save gas and avoid a call to sync.
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 407, 1878 ] }
10,725
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
TWAPBound
contract TWAPBound is YamSubGoverned { using SafeMath for uint256; uint256 public constant BASE = 10**18; /// @notice For a sale of a specific amount uint256 public sell_amount; /// @notice For a purchase of a specific amount uint256 public purchase_amount; /// @notice Token t...
update_twap
function update_twap() public { (uint256 sell_token_priceCumulative, uint32 blockTimestamp) = UniswapV2OracleLibrary.currentCumulativePrices(uniswap_pair1, saleTokenIs0); uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired // ensure that at least one full per...
// callable by anyone
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 5117, 6304 ] }
10,726
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
IndexStaking
contract IndexStaking is ReserveUniHelper { constructor(address pendingGov_, address reserves_) public { gov = msg.sender; pendingGov = pendingGov_; reserves = reserves_; IERC20(lp).approve(address(staking), uint256(-1)); } IndexStaker public staking = IndexStaker(...
stake
function stake() public { _getLPToken(); uint256 amount = IERC20(lp).balanceOf(address(this)); staking.stake(amount); }
// callable by anyone assuming twap bounds checks
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 655, 825 ] }
10,727
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
IndexStaking
contract IndexStaking is ReserveUniHelper { constructor(address pendingGov_, address reserves_) public { gov = msg.sender; pendingGov = pendingGov_; reserves = reserves_; IERC20(lp).approve(address(staking), uint256(-1)); } IndexStaker public staking = IndexStaker(...
getUnderlying
function getUnderlying() public { _getUnderlyingToken(true); }
// callable by anyone assuming twap bounds checks
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 883, 978 ] }
10,728
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
IndexStaking
contract IndexStaking is ReserveUniHelper { constructor(address pendingGov_, address reserves_) public { gov = msg.sender; pendingGov = pendingGov_; reserves = reserves_; IERC20(lp).approve(address(staking), uint256(-1)); } IndexStaker public staking = IndexStaker(...
_stakeCurrentLPBalance
function _stakeCurrentLPBalance() public onlyGovOrSubGov { uint256 amount = IERC20(lp).balanceOf(address(this)); staking.stake(amount); }
// ========= STAKING ========
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 1016, 1204 ] }
10,729
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
IndexStaking
contract IndexStaking is ReserveUniHelper { constructor(address pendingGov_, address reserves_) public { gov = msg.sender; pendingGov = pendingGov_; reserves = reserves_; IERC20(lp).approve(address(staking), uint256(-1)); } IndexStaker public staking = IndexStaker(...
_exitStaking
function _exitStaking() public onlyGovOrSubGov { staking.exit(); }
// ============================ // ========= EXITING ==========
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 2342, 2450 ] }
10,730
IndexStaking
IndexStaking.sol
0xa940e0541f8b8a40551b28d4c7e37bd85de426ff
Solidity
IndexStaking
contract IndexStaking is ReserveUniHelper { constructor(address pendingGov_, address reserves_) public { gov = msg.sender; pendingGov = pendingGov_; reserves = reserves_; IERC20(lp).approve(address(staking), uint256(-1)); } IndexStaker public staking = IndexStaker(...
_getTokenFromHere
function _getTokenFromHere(address token) public onlyGovOrSubGov { IERC20 t = IERC20(token); t.transfer(reserves, t.balanceOf(address(this))); }
// ============================
LineComment
v0.5.15+commit.6a57276f
MIT
bzzr://03fe324518d3cb1e7f9c96e627895b760bd3b4a3bdae8305c4509e3a81daac8c
{ "func_code_index": [ 3858, 4053 ] }
10,731
SubdomainRegistrar
contracts/RegistrarInterface.sol
0xecd494c1c127ee50f4fc569c5643a81f0030e0e8
Solidity
RegistrarInterface
contract RegistrarInterface { event OwnerChanged(bytes32 indexed label, address indexed oldOwner, address indexed newOwner); event DomainConfigured(bytes32 indexed label); event DomainUnlisted(bytes32 indexed label); event NewRegistration(bytes32 indexed label, string subdomain, address indexed owne...
query
function query(bytes32 label, string calldata subdomain) external view returns (string memory domain);
// InterfaceID of these four methods is 0xc1b15f5a
LineComment
v0.5.16+commit.9c3226ce
MIT
bzzr://cd3d85f775de700ef786cd63c459acbc005036a05e728cb8569507b7b8b59cae
{ "func_code_index": [ 479, 586 ] }
10,732
OctusNetworkGoldenToken
zeppelin-solidity/contracts/token/StandardToken.sol
0x3b3c6809e03244a5bbc3e76e13fb3923d7da9b62
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; event Burn(address indexed burner, uint256 value); function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); address burner = msg...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_...
/** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://bcf3502a6f5ba3c6c427c5b7b3596defdd618535c0d0064abaee483836a3e54b
{ "func_code_index": [ 744, 1201 ] }
10,733
OctusNetworkGoldenToken
zeppelin-solidity/contracts/token/StandardToken.sol
0x3b3c6809e03244a5bbc3e76e13fb3923d7da9b62
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; event Burn(address indexed burner, uint256 value); function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); address burner = msg...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
approve
function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; }
/** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * ...
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://bcf3502a6f5ba3c6c427c5b7b3596defdd618535c0d0064abaee483836a3e54b
{ "func_code_index": [ 1833, 2028 ] }
10,734
OctusNetworkGoldenToken
zeppelin-solidity/contracts/token/StandardToken.sol
0x3b3c6809e03244a5bbc3e76e13fb3923d7da9b62
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; event Burn(address indexed burner, uint256 value); function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); address burner = msg...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
allowance
function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; }
/** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://bcf3502a6f5ba3c6c427c5b7b3596defdd618535c0d0064abaee483836a3e54b
{ "func_code_index": [ 2352, 2483 ] }
10,735
OctusNetworkGoldenToken
zeppelin-solidity/contracts/token/StandardToken.sol
0x3b3c6809e03244a5bbc3e76e13fb3923d7da9b62
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; event Burn(address indexed burner, uint256 value); function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); address burner = msg...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
increaseApproval
function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
/** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://bcf3502a6f5ba3c6c427c5b7b3596defdd618535c0d0064abaee483836a3e54b
{ "func_code_index": [ 2728, 2997 ] }
10,736
PendleYieldContractDeployerBaseV2
contracts/core/abstractV2/PendleYieldTokenHolderBaseV2.sol
0x3714e5d5a32fdc16e3e6fee6788afc3ac9eb5762
Solidity
PendleYieldTokenHolderBaseV2
contract PendleYieldTokenHolderBaseV2 is IPendleYieldTokenHolderV2, WithdrawableV2 { using SafeERC20 for IERC20; using Math for uint256; using SafeMath for uint256; address public immutable override yieldToken; address public immutable override forge; address public override rewardToken; // no ...
setUpEmergencyMode
function setUpEmergencyMode(address) external pure override { revert("FUNCTION_DEPRECIATED"); }
/** @dev function has been depreciated but must still be left here to conform with the interface */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 1177, 1288 ] }
10,737
PendleYieldContractDeployerBaseV2
contracts/core/abstractV2/PendleYieldTokenHolderBaseV2.sol
0x3714e5d5a32fdc16e3e6fee6788afc3ac9eb5762
Solidity
PendleYieldTokenHolderBaseV2
contract PendleYieldTokenHolderBaseV2 is IPendleYieldTokenHolderV2, WithdrawableV2 { using SafeERC20 for IERC20; using Math for uint256; using SafeMath for uint256; address public immutable override yieldToken; address public immutable override forge; address public override rewardToken; // no ...
setUpEmergencyModeV2
function setUpEmergencyModeV2(address spender, bool) external virtual override onlyForge { // by default we store all the tokens inside this contract, so just approve IERC20(yieldToken).safeApprove(spender, type(uint256).max); IERC20(rewardToken).safeApprove(spender, type(uint256).max); }
// Only forge can call this function // this will allow a spender to spend the whole balance of the specified tokens // the spender should ideally be a contract with logic for users to withdraw out their funds.
LineComment
v0.7.6+commit.7338295f
{ "func_code_index": [ 1513, 1834 ] }
10,738
PendleYieldContractDeployerBaseV2
contracts/core/abstractV2/PendleYieldTokenHolderBaseV2.sol
0x3714e5d5a32fdc16e3e6fee6788afc3ac9eb5762
Solidity
PendleYieldTokenHolderBaseV2
contract PendleYieldTokenHolderBaseV2 is IPendleYieldTokenHolderV2, WithdrawableV2 { using SafeERC20 for IERC20; using Math for uint256; using SafeMath for uint256; address public immutable override yieldToken; address public immutable override forge; address public override rewardToken; // no ...
redeemRewards
function redeemRewards() external virtual override {}
/// @dev by default the token doesn't have any rewards
NatSpecSingleLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 1895, 1952 ] }
10,739
PendleYieldContractDeployerBaseV2
contracts/core/abstractV2/PendleYieldTokenHolderBaseV2.sol
0x3714e5d5a32fdc16e3e6fee6788afc3ac9eb5762
Solidity
PendleYieldTokenHolderBaseV2
contract PendleYieldTokenHolderBaseV2 is IPendleYieldTokenHolderV2, WithdrawableV2 { using SafeERC20 for IERC20; using Math for uint256; using SafeMath for uint256; address public immutable override yieldToken; address public immutable override forge; address public override rewardToken; // no ...
afterReceiveTokens
function afterReceiveTokens(uint256 amount) external virtual override {}
/// @dev by default we will keep all tokens in this contract, so no further actions necessary
NatSpecSingleLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 2052, 2128 ] }
10,740
PendleYieldContractDeployerBaseV2
contracts/core/abstractV2/PendleYieldTokenHolderBaseV2.sol
0x3714e5d5a32fdc16e3e6fee6788afc3ac9eb5762
Solidity
PendleYieldTokenHolderBaseV2
contract PendleYieldTokenHolderBaseV2 is IPendleYieldTokenHolderV2, WithdrawableV2 { using SafeERC20 for IERC20; using Math for uint256; using SafeMath for uint256; address public immutable override yieldToken; address public immutable override forge; address public override rewardToken; // no ...
_allowedToWithdraw
function _allowedToWithdraw(address _token) internal view virtual override returns (bool allowed) { allowed = _token != yieldToken && _token != rewardToken; }
// The governance address will be able to withdraw any tokens except for // the yieldToken and the rewardToken
LineComment
v0.7.6+commit.7338295f
{ "func_code_index": [ 2625, 2843 ] }
10,741
MistXRouter
contracts/MistXRouter.sol
0xef7973b8fcd97bd948c9a46c3ead0beb704e0f02
Solidity
MistXRouter
contract MistXRouter is Managable { /*********************** + Global Settings + ***********************/ using SafeERC20 for IERC20; // Managers are permissioned for critical functionality mapping (address => bool) public managers; address public tipjar; address public immutable WETH; address...
/// @author Nathan Worsley (https://github.com/CodeForcer) /// @title MistX Router with generic Uniswap-style support /// @notice If you came here just to copy my stuff, you NGMI - learn to code!
NatSpecSingleLine
swapExactETHForTokens
function swapExactETHForTokens( Swap calldata _swap, uint256 _bribe ) external payable { deposit(_bribe); require(_swap.path[0] == WETH, 'MistXRouter: INVALID_PATH'); uint amountIn = msg.value - _bribe; IWETH(WETH).deposit{value: amountIn}(); assert(IWETH(WETH).transfer(pairFor(_swap.path[0], _swap.path[...
/*********************** + Swap wrappers + ***********************/
NatSpecMultiLine
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 1003, 1681 ] }
10,742
MistXRouter
contracts/MistXRouter.sol
0xef7973b8fcd97bd948c9a46c3ead0beb704e0f02
Solidity
MistXRouter
contract MistXRouter is Managable { /*********************** + Global Settings + ***********************/ using SafeERC20 for IERC20; // Managers are permissioned for critical functionality mapping (address => bool) public managers; address public tipjar; address public immutable WETH; address...
/// @author Nathan Worsley (https://github.com/CodeForcer) /// @title MistX Router with generic Uniswap-style support /// @notice If you came here just to copy my stuff, you NGMI - learn to code!
NatSpecSingleLine
pairFor
function pairFor(address tokenA, address tokenB) internal view returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); uint hashed = uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), initHash // init code hash ))); pai...
// calculates the CREATE2 address for a pair without making any external calls
LineComment
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 5087, 5458 ] }
10,743
MistXRouter
contracts/MistXRouter.sol
0xef7973b8fcd97bd948c9a46c3ead0beb704e0f02
Solidity
MistXRouter
contract MistXRouter is Managable { /*********************** + Global Settings + ***********************/ using SafeERC20 for IERC20; // Managers are permissioned for critical functionality mapping (address => bool) public managers; address public tipjar; address public immutable WETH; address...
/// @author Nathan Worsley (https://github.com/CodeForcer) /// @title MistX Router with generic Uniswap-style support /// @notice If you came here just to copy my stuff, you NGMI - learn to code!
NatSpecSingleLine
getReserves
function getReserves(address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (res...
// fetches and sorts the reserves for a pair
LineComment
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 5834, 6183 ] }
10,744
MistXRouter
contracts/MistXRouter.sol
0xef7973b8fcd97bd948c9a46c3ead0beb704e0f02
Solidity
MistXRouter
contract MistXRouter is Managable { /*********************** + Global Settings + ***********************/ using SafeERC20 for IERC20; // Managers are permissioned for critical functionality mapping (address => bool) public managers; address public tipjar; address public immutable WETH; address...
/// @author Nathan Worsley (https://github.com/CodeForcer) /// @title MistX Router with generic Uniswap-style support /// @notice If you came here just to copy my stuff, you NGMI - learn to code!
NatSpecSingleLine
quote
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'MistXLibrary: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'MistXLibrary: INSUFFICIENT_LIQUIDITY'); amountB = amountA * (reserveB) / reserveA; }
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
LineComment
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 6287, 6583 ] }
10,745
MistXRouter
contracts/MistXRouter.sol
0xef7973b8fcd97bd948c9a46c3ead0beb704e0f02
Solidity
MistXRouter
contract MistXRouter is Managable { /*********************** + Global Settings + ***********************/ using SafeERC20 for IERC20; // Managers are permissioned for critical functionality mapping (address => bool) public managers; address public tipjar; address public immutable WETH; address...
/// @author Nathan Worsley (https://github.com/CodeForcer) /// @title MistX Router with generic Uniswap-style support /// @notice If you came here just to copy my stuff, you NGMI - learn to code!
NatSpecSingleLine
getAmountOut
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'MistXLibrary: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'MistXLibrary: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn * 997; uint numerator...
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
LineComment
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 6696, 7162 ] }
10,746
MistXRouter
contracts/MistXRouter.sol
0xef7973b8fcd97bd948c9a46c3ead0beb704e0f02
Solidity
MistXRouter
contract MistXRouter is Managable { /*********************** + Global Settings + ***********************/ using SafeERC20 for IERC20; // Managers are permissioned for critical functionality mapping (address => bool) public managers; address public tipjar; address public immutable WETH; address...
/// @author Nathan Worsley (https://github.com/CodeForcer) /// @title MistX Router with generic Uniswap-style support /// @notice If you came here just to copy my stuff, you NGMI - learn to code!
NatSpecSingleLine
getAmountIn
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'MistXLibrary: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'MistXLibrary: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn * amountOut * 1000; uint ...
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
LineComment
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 7274, 7699 ] }
10,747
MistXRouter
contracts/MistXRouter.sol
0xef7973b8fcd97bd948c9a46c3ead0beb704e0f02
Solidity
MistXRouter
contract MistXRouter is Managable { /*********************** + Global Settings + ***********************/ using SafeERC20 for IERC20; // Managers are permissioned for critical functionality mapping (address => bool) public managers; address public tipjar; address public immutable WETH; address...
/// @author Nathan Worsley (https://github.com/CodeForcer) /// @title MistX Router with generic Uniswap-style support /// @notice If you came here just to copy my stuff, you NGMI - learn to code!
NatSpecSingleLine
getAmountsOut
function getAmountsOut(uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'MistXLibrary: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getRese...
// performs chained getAmountOut calculations on any number of pairs
LineComment
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 7772, 8213 ] }
10,748
MistXRouter
contracts/MistXRouter.sol
0xef7973b8fcd97bd948c9a46c3ead0beb704e0f02
Solidity
MistXRouter
contract MistXRouter is Managable { /*********************** + Global Settings + ***********************/ using SafeERC20 for IERC20; // Managers are permissioned for critical functionality mapping (address => bool) public managers; address public tipjar; address public immutable WETH; address...
/// @author Nathan Worsley (https://github.com/CodeForcer) /// @title MistX Router with generic Uniswap-style support /// @notice If you came here just to copy my stuff, you NGMI - learn to code!
NatSpecSingleLine
getAmountsIn
function getAmountsIn(uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'MistXLibrary: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint...
// performs chained getAmountIn calculations on any number of pairs
LineComment
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 8285, 8747 ] }
10,749
MistXRouter
contracts/MistXRouter.sol
0xef7973b8fcd97bd948c9a46c3ead0beb704e0f02
Solidity
MistXRouter
contract MistXRouter is Managable { /*********************** + Global Settings + ***********************/ using SafeERC20 for IERC20; // Managers are permissioned for critical functionality mapping (address => bool) public managers; address public tipjar; address public immutable WETH; address...
/// @author Nathan Worsley (https://github.com/CodeForcer) /// @title MistX Router with generic Uniswap-style support /// @notice If you came here just to copy my stuff, you NGMI - learn to code!
NatSpecSingleLine
deposit
function deposit(uint256 value) public payable { (bool sent, bytes memory data) = tipjar.call{value: value}(new bytes(0)); require(sent, "Failed to send Ether"); }
/*********************** + Support functions + ***********************/
NatSpecMultiLine
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 8831, 9006 ] }
10,750
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
Ownable
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * a...
transferOwnership
function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 710, 891 ] }
10,751
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
Ownable
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * a...
renounceOwnership
function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); }
/** * @dev Allows the current owner to relinquish control of the contract. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 983, 1100 ] }
10,752
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
TokenRecipient
contract TokenRecipient { event ReceivedEther(address indexed sender, uint amount); event ReceivedTokens(address indexed from, uint256 value, address indexed token, bytes extraData); /** * @dev Receive tokens and generate a log event * @param from Address from which to transfer tokens ...
receiveApproval
function receiveApproval(address from, uint256 value, address token, bytes extraData) public { ERC20 t = ERC20(token); require(t.transferFrom(from, this, value)); emit ReceivedTokens(from, value, token, extraData); }
/** * @dev Receive tokens and generate a log event * @param from Address from which to transfer tokens * @param value Amount of tokens to transfer * @param token Address of token * @param extraData Additional data to log */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 461, 714 ] }
10,753
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
TokenRecipient
contract TokenRecipient { event ReceivedEther(address indexed sender, uint amount); event ReceivedTokens(address indexed from, uint256 value, address indexed token, bytes extraData); /** * @dev Receive tokens and generate a log event * @param from Address from which to transfer tokens ...
function () payable public { emit ReceivedEther(msg.sender, msg.value); }
/** * @dev Receive Ether and generate a log event */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 787, 879 ] }
10,754
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
ProxyRegistry
contract ProxyRegistry is Ownable { /* DelegateProxy implementation contract. Must be initialized. */ address public delegateProxyImplementation; /* Authenticated proxies by user. */ mapping(address => OwnableDelegateProxy) public proxies; /* Contracts pending access. */ mapping(addr...
startGrantAuthentication
function startGrantAuthentication (address addr) public onlyOwner { require(!contracts[addr] && pending[addr] == 0); pending[addr] = now; }
/** * Start the process to enable access for specified contract. Subject to delay period. * * @dev ProxyRegistry owner only * @param addr Address to which to grant permissions */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 1297, 1487 ] }
10,755
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
ProxyRegistry
contract ProxyRegistry is Ownable { /* DelegateProxy implementation contract. Must be initialized. */ address public delegateProxyImplementation; /* Authenticated proxies by user. */ mapping(address => OwnableDelegateProxy) public proxies; /* Contracts pending access. */ mapping(addr...
endGrantAuthentication
function endGrantAuthentication (address addr) public onlyOwner { require(!contracts[addr] && pending[addr] != 0 && ((pending[addr] + DELAY_PERIOD) < now)); pending[addr] = 0; contracts[addr] = true; }
/** * End the process to nable access for specified contract after delay period has passed. * * @dev ProxyRegistry owner only * @param addr Address to which to grant permissions */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 1706, 1967 ] }
10,756
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
ProxyRegistry
contract ProxyRegistry is Ownable { /* DelegateProxy implementation contract. Must be initialized. */ address public delegateProxyImplementation; /* Authenticated proxies by user. */ mapping(address => OwnableDelegateProxy) public proxies; /* Contracts pending access. */ mapping(addr...
revokeAuthentication
function revokeAuthentication (address addr) public onlyOwner { contracts[addr] = false; }
/** * Revoke access for specified contract. Can be done instantly. * * @dev ProxyRegistry owner only * @param addr Address of which to revoke permissions */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 2166, 2298 ] }
10,757
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
ProxyRegistry
contract ProxyRegistry is Ownable { /* DelegateProxy implementation contract. Must be initialized. */ address public delegateProxyImplementation; /* Authenticated proxies by user. */ mapping(address => OwnableDelegateProxy) public proxies; /* Contracts pending access. */ mapping(addr...
registerProxy
function registerProxy() public returns (OwnableDelegateProxy proxy) { require(proxies[msg.sender] == address(0)); proxy = new OwnableDelegateProxy(msg.sender, delegateProxyImplementation, abi.encodeWithSignature("initialize(address,address)", msg.sender, address(this))); proxies[msg.sender] =...
/** * Register a proxy contract with this registry * * @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy * @return New AuthenticatedProxy contract */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 2525, 2911 ] }
10,758
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
WyvernProxyRegistry
contract WyvernProxyRegistry is ProxyRegistry { string public constant name = "Project Wyvern Proxy Registry"; /* Whether the initial auth address has been set. */ bool public initialAddressSet = false; constructor () public { delegateProxyImplementation = new Authentica...
grantInitialAuthentication
function grantInitialAuthentication (address authAddress) onlyOwner public { require(!initialAddressSet); initialAddressSet = true; contracts[authAddress] = true; }
/** * Grant authentication to the initial Exchange protocol contract * * @dev No delay, can only be called once - after that the standard registry process with a delay must be used * @param authAddress Address of the contract to grant authentication */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 631, 855 ] }
10,759
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
OwnedUpgradeabilityStorage
contract OwnedUpgradeabilityStorage { // Current implementation address internal _implementation; // Owner of the contract address private _upgradeabilityOwner; /** * @dev Tells the address of the owner * @return the address of the owner */ function upgradeabilityOwner() public view ...
upgradeabilityOwner
function upgradeabilityOwner() public view returns (address) { return _upgradeabilityOwner; }
/** * @dev Tells the address of the owner * @return the address of the owner */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 275, 379 ] }
10,760
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
OwnedUpgradeabilityStorage
contract OwnedUpgradeabilityStorage { // Current implementation address internal _implementation; // Owner of the contract address private _upgradeabilityOwner; /** * @dev Tells the address of the owner * @return the address of the owner */ function upgradeabilityOwner() public view ...
setUpgradeabilityOwner
function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal { _upgradeabilityOwner = newUpgradeabilityOwner; }
/** * @dev Sets the address of the owner */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 437, 571 ] }
10,761
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
OwnedUpgradeabilityStorage
contract OwnedUpgradeabilityStorage { // Current implementation address internal _implementation; // Owner of the contract address private _upgradeabilityOwner; /** * @dev Tells the address of the owner * @return the address of the owner */ function upgradeabilityOwner() public view ...
implementation
function implementation() public view returns (address) { return _implementation; }
/** * @dev Tells the address of the current implementation * @return address of the current implementation */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 696, 790 ] }
10,762
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
OwnedUpgradeabilityStorage
contract OwnedUpgradeabilityStorage { // Current implementation address internal _implementation; // Owner of the contract address private _upgradeabilityOwner; /** * @dev Tells the address of the owner * @return the address of the owner */ function upgradeabilityOwner() public view ...
proxyType
function proxyType() public pure returns (uint256 proxyTypeId) { return 2; }
/** * @dev Tells the proxy type (EIP 897) * @return Proxy type, 2 for forwarding proxy */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 895, 982 ] }
10,763
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
AuthenticatedProxy
contract AuthenticatedProxy is TokenRecipient, OwnedUpgradeabilityStorage { /* Whether initialized. */ bool initialized = false; /* Address which owns this proxy. */ address public user; /* Associated registry with contract authentication information. */ ProxyRegistry public registry...
initialize
function initialize (address addrUser, ProxyRegistry addrRegistry) public { require(!initialized); initialized = true; user = addrUser; registry = addrRegistry; }
/** * Initialize an AuthenticatedProxy * * @param addrUser Address of user on whose behalf this proxy will act * @param addrRegistry Address of ProxyRegistry contract which will manage this proxy */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 904, 1126 ] }
10,764
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
AuthenticatedProxy
contract AuthenticatedProxy is TokenRecipient, OwnedUpgradeabilityStorage { /* Whether initialized. */ bool initialized = false; /* Address which owns this proxy. */ address public user; /* Associated registry with contract authentication information. */ ProxyRegistry public registry...
setRevoke
function setRevoke(bool revoke) public { require(msg.sender == user); revoked = revoke; emit Revoked(revoke); }
/** * Set the revoked flag (allows a user to revoke ProxyRegistry access) * * @dev Can be called by the user only * @param revoke Whether or not to revoke access */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 1329, 1491 ] }
10,765
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
AuthenticatedProxy
contract AuthenticatedProxy is TokenRecipient, OwnedUpgradeabilityStorage { /* Whether initialized. */ bool initialized = false; /* Address which owns this proxy. */ address public user; /* Associated registry with contract authentication information. */ ProxyRegistry public registry...
proxy
function proxy(address dest, HowToCall howToCall, bytes calldata) public returns (bool result) { require(msg.sender == user || (!revoked && registry.contracts(msg.sender))); if (howToCall == HowToCall.Call) { result = dest.call(calldata); } else if (howToCall == HowToCall.DelegateCall...
/** * Execute a message call from the proxy contract * * @dev Can be called by the user, or by a contract authorized by the registry as long as the user has not revoked access * @param dest Address to which the call will be sent * @param howToCall Which kind of call to make * @param calldata Calldata to sen...
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 1910, 2359 ] }
10,766
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
AuthenticatedProxy
contract AuthenticatedProxy is TokenRecipient, OwnedUpgradeabilityStorage { /* Whether initialized. */ bool initialized = false; /* Address which owns this proxy. */ address public user; /* Associated registry with contract authentication information. */ ProxyRegistry public registry...
proxyAssert
function proxyAssert(address dest, HowToCall howToCall, bytes calldata) public { require(proxy(dest, howToCall, calldata)); }
/** * Execute a message call and assert success * * @dev Same functionality as `proxy`, just asserts the return value * @param dest Address to which the call will be sent * @param howToCall What kind of call to make * @param calldata Calldata to send */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 2664, 2822 ] }
10,767
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
Proxy
contract Proxy { /** * @dev Tells the address of the implementation where every call will be delegated. * @return address of the implementation to which it will be delegated */ function implementation() public view returns (address); /** * @dev Tells the type of proxy (EIP 897) * @return Typ...
implementation
function implementation() public view returns (address);
/** * @dev Tells the address of the implementation where every call will be delegated. * @return address of the implementation to which it will be delegated */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 192, 251 ] }
10,768
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
Proxy
contract Proxy { /** * @dev Tells the address of the implementation where every call will be delegated. * @return address of the implementation to which it will be delegated */ function implementation() public view returns (address); /** * @dev Tells the type of proxy (EIP 897) * @return Typ...
proxyType
function proxyType() public pure returns (uint256 proxyTypeId);
/** * @dev Tells the type of proxy (EIP 897) * @return Type of proxy, 2 for upgradeable proxy */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 363, 429 ] }
10,769
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
Proxy
contract Proxy { /** * @dev Tells the address of the implementation where every call will be delegated. * @return address of the implementation to which it will be delegated */ function implementation() public view returns (address); /** * @dev Tells the type of proxy (EIP 897) * @return Typ...
function () payable public { address _impl = implementation(); require(_impl != address(0)); assembly { let ptr := mload(0x40) calldatacopy(ptr, 0, calldatasize) let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0) let size := returndatasize returndatacopy(ptr, 0, size) ...
/** * @dev Fallback function allowing to perform a delegatecall to the given implementation. * This function will return whatever the implementation call returns */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 609, 1053 ] }
10,770
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
OwnedUpgradeabilityProxy
contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage { /** * @dev Event to show ownership has been transferred * @param previousOwner representing the address of the previous owner * @param newOwner representing the address of the new owner */ event ProxyOwnershipTransferred(address ...
_upgradeTo
function _upgradeTo(address implementation) internal { require(_implementation != implementation); _implementation = implementation; emit Upgraded(implementation); }
/** * @dev Upgrades the implementation address * @param implementation representing the address of the new implementation to be set */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 734, 920 ] }
10,771
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
OwnedUpgradeabilityProxy
contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage { /** * @dev Event to show ownership has been transferred * @param previousOwner representing the address of the previous owner * @param newOwner representing the address of the new owner */ event ProxyOwnershipTransferred(address ...
proxyOwner
function proxyOwner() public view returns (address) { return upgradeabilityOwner(); }
/** * @dev Tells the address of the proxy owner * @return the address of the proxy owner */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 1195, 1291 ] }
10,772
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
OwnedUpgradeabilityProxy
contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage { /** * @dev Event to show ownership has been transferred * @param previousOwner representing the address of the previous owner * @param newOwner representing the address of the new owner */ event ProxyOwnershipTransferred(address ...
transferProxyOwnership
function transferProxyOwnership(address newOwner) public onlyProxyOwner { require(newOwner != address(0)); emit ProxyOwnershipTransferred(proxyOwner(), newOwner); setUpgradeabilityOwner(newOwner); }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 1455, 1674 ] }
10,773
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
OwnedUpgradeabilityProxy
contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage { /** * @dev Event to show ownership has been transferred * @param previousOwner representing the address of the previous owner * @param newOwner representing the address of the new owner */ event ProxyOwnershipTransferred(address ...
upgradeTo
function upgradeTo(address implementation) public onlyProxyOwner { _upgradeTo(implementation); }
/** * @dev Allows the upgradeability owner to upgrade the current implementation of the proxy. * @param implementation representing the address of the new implementation to be set. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 1876, 1983 ] }
10,774
WyvernProxyRegistry
WyvernProxyRegistry.sol
0x7fac518583390d8546c69bad5f73a44904be75a1
Solidity
OwnedUpgradeabilityProxy
contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage { /** * @dev Event to show ownership has been transferred * @param previousOwner representing the address of the previous owner * @param newOwner representing the address of the new owner */ event ProxyOwnershipTransferred(address ...
upgradeToAndCall
function upgradeToAndCall(address implementation, bytes data) payable public onlyProxyOwner { upgradeTo(implementation); require(address(this).delegatecall(data)); }
/** * @dev Allows the upgradeability owner to upgrade the current implementation of the proxy * and delegatecall the new implementation for initialization. * @param implementation representing the address of the new implementation to be set. * @param data represents the msg.data to bet sent in the low level cal...
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://66f913efcdd02e2c74a318790fea4a3cf17890793a525c07242fc2adc74ac9e3
{ "func_code_index": [ 2442, 2623 ] }
10,775
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 94, 154 ] }
10,776
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 237, 310 ] }
10,777
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 534, 616 ] }
10,778
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
allowance
function allowance(address owner, address spender) external view returns (uint256);
/** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 895, 983 ] }
10,779
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
approve
function approve(address spender, uint256 amount) external returns (bool);
/** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate ...
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 1647, 1726 ] }
10,780
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 2039, 2141 ] }
10,781
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 259, 445 ] }
10,782
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 723, 864 ] }
10,783
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 1162, 1359 ] }
10,784
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 1613, 2089 ] }
10,785
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to reve...
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 2560, 2697 ] }
10,786
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
div
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an in...
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 3188, 3471 ] }
10,787
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consumi...
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 3931, 4066 ] }
10,788
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
mod
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcod...
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 4546, 4717 ] }
10,789
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
isContract
function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codeha...
/** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: ...
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 606, 1230 ] }
10,790
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
sendValue
function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address...
/** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `tr...
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 2160, 2562 ] }
10,791
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
functionCall
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); }
/** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw ...
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 3318, 3498 ] }
10,792
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
functionCall
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 3723, 3924 ] }
10,793
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ *...
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 4294, 4525 ] }
10,794
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); }
/** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 4776, 5097 ] }
10,795
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
owner
function owner() public view returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 497, 581 ] }
10,796
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
renounceOwnership
function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); }
/** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 1139, 1292 ] }
10,797
BabyFrankenstein
BabyFrankenstein.sol
0x980d7e8c8800a74c0dcecd393bc296d1cc719406
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
transferOwnership
function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
/** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://99a972ead6b0180b9af88de2719a3be97ff5242f008fa1e59393ff4fc8fc8ba1
{ "func_code_index": [ 1442, 1691 ] }
10,798
EternalStorageProxy
Proxy.sol
0x83e9918ddee45a661a31a63474f864d77b156724
Solidity
EternalStorageProxy
contract EternalStorageProxy is EternalStorage { /** * @param contractLogic - the address of the first implementation of this contract's logic */ constructor(address contractLogic) public { // save the code address addressStorage[keccak256('proxy.implementation')] = contractLogic;...
/** * @title EternalStorage * @dev This is a proxy pattern that holds all the necessary state variables to carry out the storage of any contract. */
NatSpecMultiLine
function() external payable { //get the address of the contract holding the logic implementation address contractLogic = addressStorage[keccak256('proxy.implementation')]; assembly { //copy the data embedded in the function call that triggered the fallback calldatacopy(0x0, 0x0, ca...
/** * This function runs every time a function is invoked on this contract, it is the "fallback function" */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://7a7847732b508c4552f2c302f7d7a82333fe137a7c14be1fb55cc889555d568b
{ "func_code_index": [ 456, 1260 ] }
10,799