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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() external view returns (uint256);
| /**
* @dev Returns the amount of tokens in existence.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
90,
149
]
} | 2,900 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address account) external view returns (uint256);
| /**
* @dev Returns the amount of tokens owned by `account`.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
228,
300
]
} | 2,901 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | 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 | {
"func_code_index": [
516,
597
]
} | 2,902 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | 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 | {
"func_code_index": [
868,
955
]
} | 2,903 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | 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
* tra... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1604,
1682
]
} | 2,904 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | 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 | {
"func_code_index": [
1985,
2086
]
} | 2,905 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming language... | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| /**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
248,
428
]
} | 2,906 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming language... | 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.6.12+commit.27d51765 | {
"func_code_index": [
695,
833
]
} | 2,907 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming language... | 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.6.12+commit.27d51765 | {
"func_code_index": [
1120,
1311
]
} | 2,908 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming language... | 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.6.12+commit.27d51765 | {
"func_code_index": [
1554,
2017
]
} | 2,909 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming language... | 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 revert (co... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2475,
2609
]
} | 2,910 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming language... | 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 invalid ... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3087,
3363
]
} | 2,911 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming language... | 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 (consuming all... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3810,
3942
]
} | 2,912 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming language... | 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 opcode to r... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
4409,
4576
]
} | 2,913 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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 return fa... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | isContract | function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
... | /**
* @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 | {
"func_code_index": [
588,
1202
]
} | 2,914 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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 return fa... | /**
* @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: una... | /**
* @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 `transfer... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2115,
2510
]
} | 2,915 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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 return fa... | /**
* @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 returned... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3247,
3422
]
} | 2,916 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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 return fa... | /**
* @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.6.12+commit.27d51765 | {
"func_code_index": [
3640,
3838
]
} | 2,917 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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 return fa... | /**
* @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.6.12+commit.27d51765 | {
"func_code_index": [
4196,
4424
]
} | 2,918 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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 return fa... | /**
* @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.6.12+commit.27d51765 | {
"func_code_index": [
4668,
4985
]
} | 2,919 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | name | function name() public view returns (string memory) {
return _name;
}
| /**
* @dev Returns the name of the token.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
870,
955
]
} | 2,920 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | symbol | function symbol() public view returns (string memory) {
return _symbol;
}
| /**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1064,
1153
]
} | 2,921 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | decimals | function decimals() public view returns (uint8) {
return _decimals;
}
| /**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the v... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1772,
1857
]
} | 2,922 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | totalSupply | function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
| /**
* @dev See {IERC20-totalSupply}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1913,
2015
]
} | 2,923 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | balanceOf | function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
| /**
* @dev See {IERC20-balanceOf}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2069,
2190
]
} | 2,924 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
| /**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2389,
2565
]
} | 2,925 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | allowance | function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
| /**
* @dev See {IERC20-allowance}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2619,
2772
]
} | 2,926 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
| /**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2906,
3076
]
} | 2,927 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
| /**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* ... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3532,
3853
]
} | 2,928 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | increaseAllowance | function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
| /**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be t... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
4244,
4463
]
} | 2,929 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | decreaseAllowance | function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
| /**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be t... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
4946,
5216
]
} | 2,930 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | _transfer | function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] =... | /**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipie... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
5686,
6220
]
} | 2,931 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | _mint | function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(addre... | /** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
6486,
6860
]
} | 2,932 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | _burn | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSup... | /**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
7175,
7589
]
} | 2,933 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | _approve | function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}... | /**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
8010,
8354
]
} | 2,934 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | _setupDecimals | function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
| /**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
8673,
8765
]
} | 2,935 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
... | NatSpecMultiLine | _beforeTokenTransfer | function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
| /**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
9348,
9444
]
} | 2,936 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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, address fro... | /**
* @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 `using ... | 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 max-... | /**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
728,
1345
]
} | 2,937 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | 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, address fro... | /**
* @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 `using ... | 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 addre... | /**
* @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.enc... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2347,
3102
]
} | 2,938 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | BaseVault | abstract contract BaseVault is ERC20, ReentrancyGuard {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
IERC20 public token;
IERC20 public rewardToken;
uint public availableMin = 9500;
uint public farmKeeperFeeMin = 0;
u... | // Forked from the original yearn yVault (https://github.com/yearn/yearn-protocol/blob/develop/contracts/vaults/yVault.sol) with the following changes:
// - Introduce reward token of which the user can claim from the underlying strategy
// - Keeper fees for farm and harvest
// - Overriding transfer function to avoid re... | LineComment | balance | function balance() public view returns (uint) {
return token.balanceOf(address(this))
.add(IController(controller).balanceOf(address(this)));
}
| /* ========== VIEWS ========== */ | Comment | v0.6.12+commit.27d51765 | {
"func_code_index": [
1265,
1431
]
} | 2,939 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | BaseVault | abstract contract BaseVault is ERC20, ReentrancyGuard {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
IERC20 public token;
IERC20 public rewardToken;
uint public availableMin = 9500;
uint public farmKeeperFeeMin = 0;
u... | // Forked from the original yearn yVault (https://github.com/yearn/yearn-protocol/blob/develop/contracts/vaults/yVault.sol) with the following changes:
// - Introduce reward token of which the user can claim from the underlying strategy
// - Keeper fees for farm and harvest
// - Overriding transfer function to avoid re... | LineComment | available | function available() public view returns (uint) {
return token.balanceOf(address(this)).mul(availableMin).div(MAX);
}
| // Custom logic in here for how much the vault allows to be borrowed
// Sets minimum required on-hand to keep small withdrawals cheap | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
1571,
1698
]
} | 2,940 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | BaseVault | abstract contract BaseVault is ERC20, ReentrancyGuard {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
IERC20 public token;
IERC20 public rewardToken;
uint public availableMin = 9500;
uint public farmKeeperFeeMin = 0;
u... | // Forked from the original yearn yVault (https://github.com/yearn/yearn-protocol/blob/develop/contracts/vaults/yVault.sol) with the following changes:
// - Introduce reward token of which the user can claim from the underlying strategy
// - Keeper fees for farm and harvest
// - Overriding transfer function to avoid re... | LineComment | stakedBalanceOf | function stakedBalanceOf(address _user) public view returns(uint) {
return ITokenMaster(tokenMaster).userBalanceForPool(_user, address(this));
}
| // amount staked in token master | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
1856,
2010
]
} | 2,941 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | BaseVault | abstract contract BaseVault is ERC20, ReentrancyGuard {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
IERC20 public token;
IERC20 public rewardToken;
uint public availableMin = 9500;
uint public farmKeeperFeeMin = 0;
u... | // Forked from the original yearn yVault (https://github.com/yearn/yearn-protocol/blob/develop/contracts/vaults/yVault.sol) with the following changes:
// - Introduce reward token of which the user can claim from the underlying strategy
// - Keeper fees for farm and harvest
// - Overriding transfer function to avoid re... | LineComment | deposit | function deposit(uint _amount) external nonReentrant {
_updateReward(msg.sender);
uint _pool = balance();
token.safeTransferFrom(msg.sender, address(this), _amount);
uint shares = 0;
if (totalSupply() == 0) {
shares = _amount;
} else {
shares = (_amount.mul(totalSupply())).div(_poo... | /* ========== USER MUTATIVE FUNCTIONS ========== */ | Comment | v0.6.12+commit.27d51765 | {
"func_code_index": [
2338,
2765
]
} | 2,942 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | BaseVault | abstract contract BaseVault is ERC20, ReentrancyGuard {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
IERC20 public token;
IERC20 public rewardToken;
uint public availableMin = 9500;
uint public farmKeeperFeeMin = 0;
u... | // Forked from the original yearn yVault (https://github.com/yearn/yearn-protocol/blob/develop/contracts/vaults/yVault.sol) with the following changes:
// - Introduce reward token of which the user can claim from the underlying strategy
// - Keeper fees for farm and harvest
// - Overriding transfer function to avoid re... | LineComment | withdraw | function withdraw(uint _shares) public nonReentrant {
_updateReward(msg.sender);
uint r = (balance().mul(_shares)).div(totalSupply());
_burn(msg.sender, _shares);
// Check balance
uint b = token.balanceOf(address(this));
if (b < r) {
uint _withdraw = r.sub(b);
IController(contr... | // No rebalance implementation for lower fees and faster swaps | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
2832,
3475
]
} | 2,943 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | BaseVault | abstract contract BaseVault is ERC20, ReentrancyGuard {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
IERC20 public token;
IERC20 public rewardToken;
uint public availableMin = 9500;
uint public farmKeeperFeeMin = 0;
u... | // Forked from the original yearn yVault (https://github.com/yearn/yearn-protocol/blob/develop/contracts/vaults/yVault.sol) with the following changes:
// - Introduce reward token of which the user can claim from the underlying strategy
// - Keeper fees for farm and harvest
// - Overriding transfer function to avoid re... | LineComment | _beforeTokenTransfer | function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override
{
if (to != tokenMaster && from != tokenMaster) {
_updateReward(from);
_updateReward(to);
}
super._beforeTokenTransfer(from, to, amount);
}
| // Override underlying transfer function to update reward before transfer, except on staking/withdraw to token master | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
3954,
4236
]
} | 2,944 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | BaseVault | abstract contract BaseVault is ERC20, ReentrancyGuard {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
IERC20 public token;
IERC20 public rewardToken;
uint public availableMin = 9500;
uint public farmKeeperFeeMin = 0;
u... | // Forked from the original yearn yVault (https://github.com/yearn/yearn-protocol/blob/develop/contracts/vaults/yVault.sol) with the following changes:
// - Introduce reward token of which the user can claim from the underlying strategy
// - Keeper fees for farm and harvest
// - Overriding transfer function to avoid re... | LineComment | farm | function farm() external onlyKeeper {
uint _bal = available();
uint keeperFee = _bal.mul(farmKeeperFeeMin).div(MAX);
if (keeperFee > 0) {
token.safeTransfer(msg.sender, keeperFee);
}
uint amountLessFee = _bal.sub(keeperFee);
token.safeTransfer(controller, amountLessFee);
IControlle... | // Keepers call farm() to send funds to strategy | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
4346,
4793
]
} | 2,945 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | BaseVault | abstract contract BaseVault is ERC20, ReentrancyGuard {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
IERC20 public token;
IERC20 public rewardToken;
uint public availableMin = 9500;
uint public farmKeeperFeeMin = 0;
u... | // Forked from the original yearn yVault (https://github.com/yearn/yearn-protocol/blob/develop/contracts/vaults/yVault.sol) with the following changes:
// - Introduce reward token of which the user can claim from the underlying strategy
// - Keeper fees for farm and harvest
// - Overriding transfer function to avoid re... | LineComment | harvest | function harvest() external onlyKeeper {
uint _rewardBefore = rewardToken.balanceOf(address(this));
IController(controller).harvest(address(this));
uint _rewardAfter = rewardToken.balanceOf(address(this));
uint harvested = _rewardAfter.sub(_rewardBefore);
uint keeperFee = harvested.mul(harvestKeepe... | // Keepers call harvest() to claim rewards from strategy
// harvest() is marked as onlyEOA to prevent sandwich/MEV attack to collect most rewards through a flash-deposit() follow by a claim | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
4989,
5714
]
} | 2,946 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | BaseVault | abstract contract BaseVault is ERC20, ReentrancyGuard {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
IERC20 public token;
IERC20 public rewardToken;
uint public availableMin = 9500;
uint public farmKeeperFeeMin = 0;
u... | // Forked from the original yearn yVault (https://github.com/yearn/yearn-protocol/blob/develop/contracts/vaults/yVault.sol) with the following changes:
// - Introduce reward token of which the user can claim from the underlying strategy
// - Keeper fees for farm and harvest
// - Overriding transfer function to avoid re... | LineComment | _updateReward | function _updateReward(address account) internal {
rewards[account] = earned(account);
userRewardPerSharePaid[account] = rewardsPerShareStored;
}
| /* ========== INTERNAL FUNCTIONS ========== */ | Comment | v0.6.12+commit.27d51765 | {
"func_code_index": [
5766,
5927
]
} | 2,947 | ||
VaultSushiETHWBTC | VaultSushiETHWBTC.sol | 0x1c7ed66abe1ba029c8efceecfbfc4056b8c4bbfc | Solidity | BaseVault | abstract contract BaseVault is ERC20, ReentrancyGuard {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
IERC20 public token;
IERC20 public rewardToken;
uint public availableMin = 9500;
uint public farmKeeperFeeMin = 0;
u... | // Forked from the original yearn yVault (https://github.com/yearn/yearn-protocol/blob/develop/contracts/vaults/yVault.sol) with the following changes:
// - Introduce reward token of which the user can claim from the underlying strategy
// - Keeper fees for farm and harvest
// - Overriding transfer function to avoid re... | LineComment | setAvailableMin | function setAvailableMin(uint _availableMin) external {
require(msg.sender == governance, "!governance");
require(_availableMin < MAX, "over MAX");
availableMin = _availableMin;
}
| /* ========== RESTRICTED FUNCTIONS ========== */ | Comment | v0.6.12+commit.27d51765 | {
"func_code_index": [
5981,
6182
]
} | 2,948 | ||
OptionsPool | contracts/interfaces/IFullBPool.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | IFullBPool | interface IFullBPool is IERC20Nameable {
function rebind(
address token,
uint256 balance,
uint256 denorm
) external;
function setSwapFee(uint256 swapFee) external;
function setPublicSwap(bool publicSwap) external;
function bind(
address token,
uint256 balan... | EXIT_FEE | function EXIT_FEE() external view returns (uint256);
| // solhint-disable-next-line func-name-mixedcase | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
1204,
1260
]
} | 2,949 | ||||
TokenController | registry/contracts/Registry.sol | 0x30ae713c785672b7e7601e3253d043d9d22937c9 | Solidity | Registry | contract Registry {
struct AttributeData {
uint256 value;
bytes32 notes;
address adminAddr;
uint256 timestamp;
}
// never remove any storage variables
address public owner;
address public pendingOwner;
bool initialized;
// Stores arbitrary a... | confirmWrite | function confirmWrite(bytes32 _attribute, address _admin) internal view returns (bool) {
bytes32 attr = WRITE_PERMISSION ^ _attribute;
bytes32 kesres = bytes32(keccak256(abi.encodePacked(attr)));
return (_admin == owner || hasAttribute(_admin, kesres));
}
| // Allows a write if either a) the writer is that Registry's owner, or
// b) the writer is writing to attribute foo and that writer already has
// the canWriteTo-foo attribute set (in that same Registry) | LineComment | v0.5.8+commit.23d335f2 | bzzr://9ce83a31bede9c87f6525cf84de5aa8be1bd414901fa9945612925767de18213 | {
"func_code_index": [
1852,
2145
]
} | 2,950 | |||
TokenController | registry/contracts/Registry.sol | 0x30ae713c785672b7e7601e3253d043d9d22937c9 | Solidity | Registry | contract Registry {
struct AttributeData {
uint256 value;
bytes32 notes;
address adminAddr;
uint256 timestamp;
}
// never remove any storage variables
address public owner;
address public pendingOwner;
bool initialized;
// Stores arbitrary a... | setAttribute | function setAttribute(address _who, bytes32 _attribute, uint256 _value, bytes32 _notes) public {
require(confirmWrite(_attribute, msg.sender));
attributes[_who][_attribute] = AttributeData(_value, _notes, msg.sender, block.timestamp);
emit SetAttribute(_who, _attribute, _value, _notes, msg.sender);
... | // Writes are allowed only if the accessManager approves | LineComment | v0.5.8+commit.23d335f2 | bzzr://9ce83a31bede9c87f6525cf84de5aa8be1bd414901fa9945612925767de18213 | {
"func_code_index": [
2210,
2775
]
} | 2,951 | |||
TokenController | registry/contracts/Registry.sol | 0x30ae713c785672b7e7601e3253d043d9d22937c9 | Solidity | Registry | contract Registry {
struct AttributeData {
uint256 value;
bytes32 notes;
address adminAddr;
uint256 timestamp;
}
// never remove any storage variables
address public owner;
address public pendingOwner;
bool initialized;
// Stores arbitrary a... | hasAttribute | function hasAttribute(address _who, bytes32 _attribute) public view returns (bool) {
return attributes[_who][_attribute].value != 0;
}
| // Returns true if the uint256 value stored for this attribute is non-zero | LineComment | v0.5.8+commit.23d335f2 | bzzr://9ce83a31bede9c87f6525cf84de5aa8be1bd414901fa9945612925767de18213 | {
"func_code_index": [
4139,
4292
]
} | 2,952 | |||
TokenController | registry/contracts/Registry.sol | 0x30ae713c785672b7e7601e3253d043d9d22937c9 | Solidity | Registry | contract Registry {
struct AttributeData {
uint256 value;
bytes32 notes;
address adminAddr;
uint256 timestamp;
}
// never remove any storage variables
address public owner;
address public pendingOwner;
bool initialized;
// Stores arbitrary a... | getAttribute | function getAttribute(address _who, bytes32 _attribute) public view returns (uint256, bytes32, address, uint256) {
AttributeData memory data = attributes[_who][_attribute];
return (data.value, data.notes, data.adminAddr, data.timestamp);
}
| // Returns the exact value of the attribute, as well as its metadata | LineComment | v0.5.8+commit.23d335f2 | bzzr://9ce83a31bede9c87f6525cf84de5aa8be1bd414901fa9945612925767de18213 | {
"func_code_index": [
4371,
4638
]
} | 2,953 | |||
TokenController | registry/contracts/Registry.sol | 0x30ae713c785672b7e7601e3253d043d9d22937c9 | Solidity | Registry | contract Registry {
struct AttributeData {
uint256 value;
bytes32 notes;
address adminAddr;
uint256 timestamp;
}
// never remove any storage variables
address public owner;
address public pendingOwner;
bool initialized;
// Stores arbitrary a... | transferOwnership | function transferOwnership(address newOwner) public onlyOwner {
pendingOwner = newOwner;
}
| /**
* @dev Allows the current owner to set the pendingOwner address.
* @param newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.5.8+commit.23d335f2 | bzzr://9ce83a31bede9c87f6525cf84de5aa8be1bd414901fa9945612925767de18213 | {
"func_code_index": [
6524,
6633
]
} | 2,954 | |||
TokenController | registry/contracts/Registry.sol | 0x30ae713c785672b7e7601e3253d043d9d22937c9 | Solidity | Registry | contract Registry {
struct AttributeData {
uint256 value;
bytes32 notes;
address adminAddr;
uint256 timestamp;
}
// never remove any storage variables
address public owner;
address public pendingOwner;
bool initialized;
// Stores arbitrary a... | claimOwnership | function claimOwnership() public onlyPendingOwner {
emit OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
pendingOwner = address(0);
}
| /**
* @dev Allows the pendingOwner address to finalize the transfer.
*/ | NatSpecMultiLine | v0.5.8+commit.23d335f2 | bzzr://9ce83a31bede9c87f6525cf84de5aa8be1bd414901fa9945612925767de18213 | {
"func_code_index": [
6723,
6910
]
} | 2,955 | |||
OptionsPool | contracts/rewards/CheckToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | CheckToken | contract CheckToken is ERC20("CheckToken", "CHK"), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (Queen).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
... | // import "hardhat/console.sol";
// CheckToken with Governance. | LineComment | mint | function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
| /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (Queen). | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
153,
316
]
} | 2,956 | ||
OptionsPool | contracts/rewards/CheckToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | CheckToken | contract CheckToken is ERC20("CheckToken", "CHK"), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (Queen).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
... | // import "hardhat/console.sol";
// CheckToken with Governance. | LineComment | delegates | function delegates(address delegator)
external
view
returns (address)
{
return _delegates[delegator];
}
| /**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegator The address to get delegatee for
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2398,
2545
]
} | 2,957 | ||
OptionsPool | contracts/rewards/CheckToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | CheckToken | contract CheckToken is ERC20("CheckToken", "CHK"), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (Queen).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
... | // import "hardhat/console.sol";
// CheckToken with Governance. | LineComment | delegate | function delegate(address delegatee) external {
return _delegate(msg.sender, delegatee);
}
| /**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2679,
2785
]
} | 2,958 | ||
OptionsPool | contracts/rewards/CheckToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | CheckToken | contract CheckToken is ERC20("CheckToken", "CHK"), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (Queen).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
... | // import "hardhat/console.sol";
// CheckToken with Governance. | LineComment | delegateBySig | function delegateBySig(
address delegatee,
uint nonce,
uint expiry,
uint8 v,
bytes32 r,
bytes32 s
)
external
{
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name())),
getChainId(),
address(this)
... | /**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA sig... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3204,
4342
]
} | 2,959 | ||
OptionsPool | contracts/rewards/CheckToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | CheckToken | contract CheckToken is ERC20("CheckToken", "CHK"), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (Queen).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
... | // import "hardhat/console.sol";
// CheckToken with Governance. | LineComment | getCurrentVotes | function getCurrentVotes(address account)
external
view
returns (uint256)
{
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
| /**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
4532,
4784
]
} | 2,960 | ||
OptionsPool | contracts/rewards/CheckToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | CheckToken | contract CheckToken is ERC20("CheckToken", "CHK"), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (Queen).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
... | // import "hardhat/console.sol";
// CheckToken with Governance. | LineComment | getPriorVotes | function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
require(blockNumber < block.number, "CHK::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most rec... | /**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @r... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
5202,
6422
]
} | 2,961 | ||
KoinTradeExchange | KoinTradeExchange.sol | 0xd7e108b5e41cbde25461ba095cef7d4c2159a060 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
... | totalSupply | function totalSupply() constant returns (uint256 supply) {}
| /// @return total amount of tokens | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bdf7ed3456f9ecf5f76c2f88ba11b7614f25663cff35aed7652808070ba7cb1b | {
"func_code_index": [
69,
133
]
} | 2,962 | |||
KoinTradeExchange | KoinTradeExchange.sol | 0xd7e108b5e41cbde25461ba095cef7d4c2159a060 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
... | balanceOf | function balanceOf(address _owner) constant returns (uint256 balance) {}
| /// @param _owner The address from which the balance will be retrieved
/// @return The balance | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bdf7ed3456f9ecf5f76c2f88ba11b7614f25663cff35aed7652808070ba7cb1b | {
"func_code_index": [
241,
318
]
} | 2,963 | |||
KoinTradeExchange | KoinTradeExchange.sol | 0xd7e108b5e41cbde25461ba095cef7d4c2159a060 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
... | transfer | function transfer(address _to, uint256 _value) returns (bool success) {}
| /// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bdf7ed3456f9ecf5f76c2f88ba11b7614f25663cff35aed7652808070ba7cb1b | {
"func_code_index": [
555,
632
]
} | 2,964 | |||
KoinTradeExchange | KoinTradeExchange.sol | 0xd7e108b5e41cbde25461ba095cef7d4c2159a060 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
... | transferFrom | function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
| /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bdf7ed3456f9ecf5f76c2f88ba11b7614f25663cff35aed7652808070ba7cb1b | {
"func_code_index": [
955,
1051
]
} | 2,965 | |||
KoinTradeExchange | KoinTradeExchange.sol | 0xd7e108b5e41cbde25461ba095cef7d4c2159a060 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
... | approve | function approve(address _spender, uint256 _value) returns (bool success) {}
| /// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bdf7ed3456f9ecf5f76c2f88ba11b7614f25663cff35aed7652808070ba7cb1b | {
"func_code_index": [
1335,
1416
]
} | 2,966 | |||
KoinTradeExchange | KoinTradeExchange.sol | 0xd7e108b5e41cbde25461ba095cef7d4c2159a060 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
... | allowance | function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
| /// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bdf7ed3456f9ecf5f76c2f88ba11b7614f25663cff35aed7652808070ba7cb1b | {
"func_code_index": [
1624,
1721
]
} | 2,967 | |||
KoinTradeExchange | KoinTradeExchange.sol | 0xd7e108b5e41cbde25461ba095cef7d4c2159a060 | Solidity | KoinTradeExchange | contract KoinTradeExchange is StandardToken { // CHANGE THIS. Update the contract name.
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the co... | KoinTradeExchange | function KoinTradeExchange() {
balances[msg.sender] = 900000000000000000000000000; // Give the creator all initial tokens. This is set to 1000 for example. If you want your initial tokens to be X and your decimal is 5, set this value to X * 100000. (CHANGE THIS)
totalSupply = 9000000000000000000... | // Where should the raised ETH go?
// This is a constructor function
// which means the following function name has to match the contract name declared above | LineComment | v0.4.24+commit.e67f0147 | bzzr://bdf7ed3456f9ecf5f76c2f88ba11b7614f25663cff35aed7652808070ba7cb1b | {
"func_code_index": [
1201,
2229
]
} | 2,968 | |||
KoinTradeExchange | KoinTradeExchange.sol | 0xd7e108b5e41cbde25461ba095cef7d4c2159a060 | Solidity | KoinTradeExchange | contract KoinTradeExchange is StandardToken { // CHANGE THIS. Update the contract name.
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the co... | batchTransfer | function batchTransfer(address[] _dests, uint256[] _values) public {
require(_dests.length == _values.length);
uint256 i = 0;
while (i < _dests.length) {
transfer(_dests[i], _values[i]);
i += 1;
}
}
| /**
* @dev Batch transfer some tokens to some addresses, address and value is one-on-one.
* @param _dests Array of addresses
* @param _values Array of transfer tokens number
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://bdf7ed3456f9ecf5f76c2f88ba11b7614f25663cff35aed7652808070ba7cb1b | {
"func_code_index": [
2978,
3248
]
} | 2,969 | |||
KoinTradeExchange | KoinTradeExchange.sol | 0xd7e108b5e41cbde25461ba095cef7d4c2159a060 | Solidity | KoinTradeExchange | contract KoinTradeExchange is StandardToken { // CHANGE THIS. Update the contract name.
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the co... | batchTransferSingleValue | function batchTransferSingleValue(address[] _dests, uint256 _value) public {
uint256 i = 0;
while (i < _dests.length) {
transfer(_dests[i], _value);
i += 1;
}
}
| /**
* @dev Batch transfer equal tokens amout to some addresses
* @param _dests Array of addresses
* @param _value Number of transfer tokens amount
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://bdf7ed3456f9ecf5f76c2f88ba11b7614f25663cff35aed7652808070ba7cb1b | {
"func_code_index": [
3426,
3649
]
} | 2,970 | |||
KoinTradeExchange | KoinTradeExchange.sol | 0xd7e108b5e41cbde25461ba095cef7d4c2159a060 | Solidity | KoinTradeExchange | contract KoinTradeExchange is StandardToken { // CHANGE THIS. Update the contract name.
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the co... | approveAndCall | function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually s... | /* Approves and then calls the receiving contract */ | Comment | v0.4.24+commit.e67f0147 | bzzr://bdf7ed3456f9ecf5f76c2f88ba11b7614f25663cff35aed7652808070ba7cb1b | {
"func_code_index": [
3710,
4515
]
} | 2,971 | |||
IiinoCoin | contracts/Ownable.sol | 0x48c71990d24f18a441b881e13983e4621fcd812f | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.send... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | Ownable | function Ownable() public {
owner = msg.sender;
}
| /**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/ | NatSpecMultiLine | v0.4.21+commit.dfe3193c | bzzr://6743e49142cb6d45b5afd276952c40d63d4477401d2a03306bb949f6d6477ef6 | {
"func_code_index": [
263,
331
]
} | 2,972 | |
IiinoCoin | contracts/Ownable.sol | 0x48c71990d24f18a441b881e13983e4621fcd812f | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.send... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) external 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.21+commit.dfe3193c | bzzr://6743e49142cb6d45b5afd276952c40d63d4477401d2a03306bb949f6d6477ef6 | {
"func_code_index": [
662,
861
]
} | 2,973 | |
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | TokenController | contract TokenController {
/// @notice Called when `_owner` sends ether to the MiniMe Token contract
/// @param _owner The address that sent the ether to create tokens
/// @return True if the ether is accepted, false if it throws
function proxyPayment(address _owner) public payable returns(bool);
... | proxyPayment | function proxyPayment(address _owner) public payable returns(bool);
| /// @notice Called when `_owner` sends ether to the MiniMe Token contract
/// @param _owner The address that sent the ether to create tokens
/// @return True if the ether is accepted, false if it throws | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
246,
318
]
} | 2,974 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | TokenController | contract TokenController {
/// @notice Called when `_owner` sends ether to the MiniMe Token contract
/// @param _owner The address that sent the ether to create tokens
/// @return True if the ether is accepted, false if it throws
function proxyPayment(address _owner) public payable returns(bool);
... | onTransfer | function onTransfer(address _from, address _to, uint _amount) public returns(bool);
| /// @notice Notifies the controller about a token transfer allowing the
/// controller to react if desired
/// @param _from The origin of the transfer
/// @param _to The destination of the transfer
/// @param _amount The amount of the transfer
/// @return False if the controller does not authorize the transfer | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
664,
752
]
} | 2,975 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | TokenController | contract TokenController {
/// @notice Called when `_owner` sends ether to the MiniMe Token contract
/// @param _owner The address that sent the ether to create tokens
/// @return True if the ether is accepted, false if it throws
function proxyPayment(address _owner) public payable returns(bool);
... | onApprove | function onApprove(address _owner, address _spender, uint _amount) public
returns(bool);
| /// @notice Notifies the controller about an approval allowing the
/// controller to react if desired
/// @param _owner The address that calls `approve()`
/// @param _spender The spender in the `approve()` call
/// @param _amount The amount in the `approve()` call
/// @return False if the controller does not authorize... | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
1119,
1221
]
} | 2,976 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
... | 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.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
635,
816
]
} | 2,977 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | Controlled | contract Controlled {
/// @notice The address of the controller is the only address that can call
/// a function with this modifier
modifier onlyController { require(msg.sender == controller); _; }
address public controller;
constructor() public { controller = msg.sender;}
/// @noti... | changeController | function changeController(address _newController) public onlyController {
controller = _newController;
}
| /// @notice Changes the controller of the contract
/// @param _newController The new controller of the contract | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
429,
552
]
} | 2,978 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | transfer | function transfer(address _to, uint256 _amount) public returns (bool success) {
require(transfersEnabled);
doTransfer(msg.sender, _to, _amount);
return true;
}
| ///////////////////
/// @notice Send `_amount` tokens to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return Whether the transfer was successful or not | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
3443,
3639
]
} | 2,979 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | transferFrom | function transferFrom(address _from, address _to, uint256 _amount
) public returns (bool success) {
// The controller of this contract can move tokens around at will,
// this is important to recognize! Confirm that you trust the
// controller of this contract, which in most situations should be
... | /// @notice Send `_amount` tokens to `_to` from `_from` on the condition it
/// is approved by `_from`
/// @param _from The address holding the tokens being transferred
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return True if the transfer was successful | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
3992,
4724
]
} | 2,980 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | doTransfer | function doTransfer(address _from, address _to, uint256 _amount
) internal {
if (_amount == 0) {
emit Transfer(_from, _to, _amount); // Follow the spec to louch the event when transfer 0
return;
}
require(parentSnapShotBlock < block.number);
// Do not allow transfer to 0x... | /// @dev This is the actual transfer function in the token contract, it can
/// only be called by other functions in this contract.
/// @param _from The address holding the tokens being transferred
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return True if... | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
5106,
6638
]
} | 2,981 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | balanceOf | function balanceOf(address _owner) public view returns (uint256 balance) {
return balanceOfAt(_owner, block.number);
}
| /// @param _owner The address that's balance is being requested
/// @return The balance of `_owner` at the current block | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
6772,
6909
]
} | 2,982 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | approve | function approve(address _spender, uint256 _amount) public returns (bool success) {
require(transfersEnabled);
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender,0)` if it is not
// already 0 to mitigate the race condition de... | /// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on
/// its behalf. This is a modified version of the ERC20 approve function
/// to be a little bit safer
/// @param _spender The address of the account able to transfer the tokens
/// @param _amount The amount of tokens to be approved for transfer... | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
7311,
8167
]
} | 2,983 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | allowance | function allowance(address _owner, address _spender
) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
| /// @dev This function makes it easy to read the `allowed[]` map
/// @param _owner The address of the account that owns the token
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens of _owner that _spender is allowed
/// to spend | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
8488,
8643
]
} | 2,984 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | approveAndCall | function approveAndCall(address _spender, uint256 _amount, bytes _extraData
) public returns (bool success) {
require(approve(_spender, _amount));
if (isContract(_spender)) {
ApproveAndCallFallBack(_spender).receiveApproval(
msg.sender,
_amount,
this,
... | /// @notice `msg.sender` approves `_spender` to send `_amount` tokens on
/// its behalf, and then a function is triggered in the contract that is
/// being approved, `_spender`. This allows users to use their tokens to
/// interact with contracts in one function call instead of two
/// @param _spender The address of... | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
9164,
9595
]
} | 2,985 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | totalSupply | function totalSupply() public view returns (uint256) {
return totalSupplyAt(block.number);
}
| /// @dev This function makes it easy to get the total number of tokens
/// @return The total number of tokens | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
9718,
9829
]
} | 2,986 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | balanceOfAt | function balanceOfAt(address _owner, uint256 _blockNumber) public view
returns (uint256) {
// These next few lines are used when the balance of the token is
// requested before a check point was ever created for this token, it
// requires that the `parentToken.balanceOfAt` be queried at the
... | ////////////////
/// @dev Queries the balance of `_owner` at a specific `_blockNumber`
/// @param _owner The address from which the balance will be retrieved
/// @param _blockNumber The block number when the balance is queried
/// @return The balance at `_blockNumber` | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
10189,
11155
]
} | 2,987 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | totalSupplyAt | function totalSupplyAt(uint256 _blockNumber) public view returns(uint256) {
// These next few lines are used when the totalSupply of the token is
// requested before a check point was ever created for this token, it
// requires that the `parentToken.totalSupplyAt` be queried at the
// genesis b... | /// @notice Total amount of tokens at a specific `_blockNumber`.
/// @param _blockNumber The block number when the totalSupply is queried
/// @return The total amount of tokens at `_blockNumber` | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
11368,
12304
]
} | 2,988 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | generateTokens | function generateTokens(address _owner, uint256 _amount
) public onlyController returns (bool) {
uint256 curTotalSupply = totalSupply();
require(curTotalSupply + _amount >= curTotalSupply); // Check for overflow
uint256 previousBalanceTo = balanceOf(_owner);
require(previousBalanceTo + _amount >= p... | ////////////////
/// @notice Generates `_amount` tokens that are assigned to `_owner`
/// @param _owner The address that will be assigned the new tokens
/// @param _amount The quantity of tokens generated
/// @return True if the tokens are generated correctly | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
12640,
13245
]
} | 2,989 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | destroyTokens | function destroyTokens(address _owner, uint256 _amount
) onlyController public returns (bool) {
uint256 curTotalSupply = totalSupply();
require(curTotalSupply >= _amount);
uint256 previousBalanceFrom = balanceOf(_owner);
require(previousBalanceFrom >= _amount);
updateValueAtNow(totalSupplyHist... | /// @notice Burns `_amount` tokens from `_owner`
/// @param _owner The address that will lose the tokens
/// @param _amount The quantity of tokens to burn
/// @return True if the tokens are burned correctly | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
13477,
14006
]
} | 2,990 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | enableTransfers | function enableTransfers(bool _transfersEnabled) public onlyController {
transfersEnabled = _transfersEnabled;
}
| ////////////////
/// @notice Enables token holders to transfer their tokens freely if true
/// @param _transfersEnabled True if transfers are allowed in the clone | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
14233,
14364
]
} | 2,991 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | getValueAt | function getValueAt(Checkpoint[] storage checkpoints, uint256 _block
) view internal returns (uint256) {
if (checkpoints.length == 0) return 0;
// Shortcut for the actual value
if (_block >= checkpoints[checkpoints.length-1].fromBlock)
return checkpoints[checkpoints.length-1].value;
if (... | ////////////////
/// @dev `getValueAt` retrieves the number of tokens at a given block number
/// @param checkpoints The history of values being queried
/// @param _block The block number to retrieve the value at
/// @return The number of tokens being queried | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
14743,
15550
]
} | 2,992 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | updateValueAtNow | function updateValueAtNow(Checkpoint[] storage checkpoints, uint256 _value
) internal {
if ((checkpoints.length == 0) || (checkpoints[checkpoints.length - 1].fromBlock < block.number)) {
Checkpoint storage newCheckPoint = checkpoints[checkpoints.length++];
newCheckPoint.fromBlock = uint128(bloc... | /// @dev `updateValueAtNow` used to update the `balances` map and the
/// `totalSupplyHistory`
/// @param checkpoints The history of data being updated
/// @param _value The new number of tokens | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
15769,
16343
]
} | 2,993 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | isContract | function isContract(address _addr) view internal returns(bool) {
uint256 size;
if (_addr == 0) return false;
assembly {
size := extcodesize(_addr)
}
return size>0;
}
| /// @dev Internal function to determine if an address is a contract
/// @param _addr The address being queried
/// @return True if `_addr` is a contract | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
16514,
16747
]
} | 2,994 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | min | function min(uint256 a, uint256 b) pure internal returns (uint256) {
return a < b ? a : b;
}
| /// @dev Helper function to return a min betwen the two uints | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
16817,
16928
]
} | 2,995 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | function () public payable {
require(isContract(controller));
require(TokenController(controller).proxyPayment.value(msg.value)(msg.sender));
}
| /// @notice The fallback function: If the contract's controller has not been
/// set to 0, then the `proxyPayment` method is called which relays the
/// ether and creates tokens as described in the token controller contract | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
17172,
17343
]
} | 2,996 | ||||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | MiniMeToken | contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = "MMT_0.2"; //An arbitra... | claimTokens | function claimTokens(address _token) public onlyController {
if (_token == 0x0) {
controller.transfer(address(this).balance);
return;
}
MiniMeToken token = MiniMeToken(_token);
uint256 balance = token.balanceOf(this);
token.transfer(controller, balance);
emit ClaimedTok... | //////////
/// @notice This method can be used by the controller to extract mistakenly
/// sent tokens to this contract.
/// @param _token The address of the token contract that you want to recover
/// set to 0 in case you want to extract ether. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
17648,
18045
]
} | 2,997 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | ERC677 | contract ERC677 is MiniMeToken {
/**
* @dev ERC677 constructor is just a fallback to the MiniMeToken constructor
*/
constructor(address _parentToken, uint _parentSnapShotBlock, string _tokenName, uint8 _decimalUnits, string _tokenSymbol, bool _transfersEnabled) public MiniMeToken(
_pare... | transferAndCall | function transferAndCall(address _to, uint _amount, bytes _data) public returns (bool) {
require(transfer(_to, _amount));
emit Transfer(msg.sender, _to, _amount, _data);
// call receiver
if (isContract(_to)) {
ERC677Receiver(_to).tokenFallback(msg.sender, _amount, _data);
}
... | /**
* @notice `msg.sender` transfers `_amount` to `_to` contract and then tokenFallback() function is triggered in the `_to` contract.
* @param _to The address of the contract able to receive the tokens
* @param _amount The amount of tokens to be transferred
* @param _data The payload to be treated by `_to` co... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
861,
1233
]
} | 2,998 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | SmarcToken | contract SmarcToken is ERC677, Ownable {
// mapping for locking certain addresses
mapping(address => uint256) public lockups;
event LockedTokens(address indexed _holder, uint256 _lockup);
// burnable address
address public burnable;
/**
* @dev Smarc constructor just parametri... | setLocks | function setLocks(address[] _holders, uint256[] _lockups) public onlyController {
require(_holders.length == _lockups.length);
require(_holders.length < 256);
require(transfersEnabled == false);
for (uint8 i = 0; i < _holders.length; i++) {
address holder = _holders[i];
uint256 l... | /**
* @notice Sets the locks of an array of addresses.
* @dev Must be called while minting (enableTransfers = false). Sizes of `_holder` and `_lockups` must be the same.
* @param _holders The array of investor addresses
* @param _lockups The array of timestamps until which corresponding address must be locked
... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
1273,
1869
]
} | 2,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.