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
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) retu...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; }
/** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 3428, 3531 ] }
3,507
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) retu...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting 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 (consu...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 3982, 4085 ] }
3,508
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) retu...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterp...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 4547, 4758 ] }
3,509
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) retu...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
div
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } }
/** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invali...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 5463, 5673 ] }
3,510
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) retu...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. ...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 6317, 6527 ] }
3,511
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
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 f...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
isContract
function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly ...
/** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: ...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 590, 1017 ] }
3,512
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
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 f...
/** * @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...
/** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `tr...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 1932, 2334 ] }
3,513
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
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 f...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); }
/** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw ...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 3073, 3251 ] }
3,514
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
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 f...
/** * @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.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 3471, 3671 ] }
3,515
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
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 f...
/** * @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.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 4031, 4262 ] }
3,516
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
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 f...
/** * @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"); require(isContract(target), "Address: call to non-contract"); // solhint-disa...
/** * @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.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 4508, 5043 ] }
3,517
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
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 f...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionStaticCall
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 5218, 5422 ] }
3,518
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
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 f...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionStaticCall
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.stat...
/** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 5604, 6031 ] }
3,519
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
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 f...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionDelegateCall
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 6208, 6413 ] }
3,520
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
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 f...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionDelegateCall
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.deleg...
/** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 6597, 7025 ] }
3,521
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { _owner = _msgSender(); ...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
owner
function owner() public view virtual returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 450, 542 ] }
3,522
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { _owner = _msgSender(); ...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
renounceOwnership
function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); }
/** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 1093, 1246 ] }
3,523
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { _owner = _msgSender(); ...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
/** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 1393, 1642 ] }
3,524
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
Solidity
DegenUnitToken
contract DegenUnitToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; uint8 private _decimals = 9; // string private _name = "DEGEN UNIT"; string private _symbol = "DEGEN UNIT"; uint256 private _tTotal = 1000 * 10**9 * 10**uint256(_decima...
// contract implementation
LineComment
//to recieve ETH
LineComment
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 6905, 6939 ] }
3,525
DegenUnitToken
DegenUnitToken.sol
0xa9b78c8b8e6a34d20c75a9864e128bcc83184cfe
Solidity
DegenUnitToken
contract DegenUnitToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; uint8 private _decimals = 9; // string private _name = "DEGEN UNIT"; string private _symbol = "DEGEN UNIT"; uint256 private _tTotal = 1000 * 10**9 * 10**uint256(_decima...
// contract implementation
LineComment
_tokenTransfer
function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipie...
//this method is responsible for taking all fee, if takeFee is true
LineComment
v0.8.7+commit.e28d00a7
None
ipfs://b9f3ba3a0ddb88a281aaa73b9c4fbf24fd114e6c85f18438083f9c4e21b8e8e6
{ "func_code_index": [ 13022, 13845 ] }
3,526
OVM_L1ETHGateway
contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol
0x40c9067ec8087ecf101fc10d2673636955b81a32
Solidity
OVM_L1ETHGateway
contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver { /******************** * Public Constants * ********************/ uint32 public constant override getFinalizeDepositL2Gas = 1200000; /******************************** * External Contract References...
/** * @title OVM_L1ETHGateway * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2. * * Compiler used: solc * Runtime target: EVM */
NatSpecMultiLine
initialize
function initialize( address _libAddressManager, address _ovmEth ) public { require(libAddressManager == Lib_AddressManager(0), "Contract has already been initialized."); libAddressManager = Lib_AddressManager(_libAddressManager); ovmEth = _ovmEth; messenger = resolve("Proxy__OVM_L1CrossDoma...
/** * @param _libAddressManager Address manager for this OE deployment * @param _ovmEth L2 OVM_ETH implementation of iOVM_DepositedToken */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 902, 1282 ] }
3,527
OVM_L1ETHGateway
contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol
0x40c9067ec8087ecf101fc10d2673636955b81a32
Solidity
OVM_L1ETHGateway
contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver { /******************** * Public Constants * ********************/ uint32 public constant override getFinalizeDepositL2Gas = 1200000; /******************************** * External Contract References...
/** * @title OVM_L1ETHGateway * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2. * * Compiler used: solc * Runtime target: EVM */
NatSpecMultiLine
/************** * Depositing * **************/
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 1346, 1454 ] }
3,528
OVM_L1ETHGateway
contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol
0x40c9067ec8087ecf101fc10d2673636955b81a32
Solidity
OVM_L1ETHGateway
contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver { /******************** * Public Constants * ********************/ uint32 public constant override getFinalizeDepositL2Gas = 1200000; /******************************** * External Contract References...
/** * @title OVM_L1ETHGateway * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2. * * Compiler used: solc * Runtime target: EVM */
NatSpecMultiLine
deposit
function deposit() external override payable { _initiateDeposit(msg.sender, msg.sender); }
/** * @dev deposit an amount of the ETH to the caller's balance on L2 */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 1543, 1677 ] }
3,529
OVM_L1ETHGateway
contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol
0x40c9067ec8087ecf101fc10d2673636955b81a32
Solidity
OVM_L1ETHGateway
contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver { /******************** * Public Constants * ********************/ uint32 public constant override getFinalizeDepositL2Gas = 1200000; /******************************** * External Contract References...
/** * @title OVM_L1ETHGateway * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2. * * Compiler used: solc * Runtime target: EVM */
NatSpecMultiLine
depositTo
function depositTo( address _to ) external override payable { _initiateDeposit(msg.sender, _to); }
/** * @dev deposit an amount of ETH to a recipients's balance on L2 * @param _to L2 address to credit the withdrawal to */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 1821, 1975 ] }
3,530
OVM_L1ETHGateway
contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol
0x40c9067ec8087ecf101fc10d2673636955b81a32
Solidity
OVM_L1ETHGateway
contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver { /******************** * Public Constants * ********************/ uint32 public constant override getFinalizeDepositL2Gas = 1200000; /******************************** * External Contract References...
/** * @title OVM_L1ETHGateway * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2. * * Compiler used: solc * Runtime target: EVM */
NatSpecMultiLine
_initiateDeposit
function _initiateDeposit( address _from, address _to ) internal { // Construct calldata for l2ETHGateway.finalizeDeposit(_to, _amount) bytes memory data = abi.encodeWithSelector( iOVM_L2DepositedToken.finalizeDeposit.selector, _to, msg.value ); ...
/** * @dev Performs the logic for deposits by storing the ETH and informing the L2 ETH Gateway of the deposit. * * @param _from Account to pull the deposit from on L1 * @param _to Account to give the deposit to on L2 */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 2226, 2807 ] }
3,531
OVM_L1ETHGateway
contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol
0x40c9067ec8087ecf101fc10d2673636955b81a32
Solidity
OVM_L1ETHGateway
contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver { /******************** * Public Constants * ********************/ uint32 public constant override getFinalizeDepositL2Gas = 1200000; /******************************** * External Contract References...
/** * @title OVM_L1ETHGateway * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2. * * Compiler used: solc * Runtime target: EVM */
NatSpecMultiLine
finalizeWithdrawal
function finalizeWithdrawal( address _to, uint256 _amount ) external override onlyFromCrossDomainAccount(ovmEth) { _safeTransferETH(_to, _amount); emit WithdrawalFinalized(_to, _amount); }
/** * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the * L1 ETH token. * Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized. * * @param _to L1 address to credit the withdrawal to * @param _amount Amount of ...
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 3280, 3541 ] }
3,532
OVM_L1ETHGateway
contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol
0x40c9067ec8087ecf101fc10d2673636955b81a32
Solidity
OVM_L1ETHGateway
contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver { /******************** * Public Constants * ********************/ uint32 public constant override getFinalizeDepositL2Gas = 1200000; /******************************** * External Contract References...
/** * @title OVM_L1ETHGateway * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2. * * Compiler used: solc * Runtime target: EVM */
NatSpecMultiLine
_safeTransferETH
function _safeTransferETH( address _to, uint256 _value ) internal { (bool success, ) = _to.call{value: _value}(new bytes(0)); require(success, 'TransferHelper::safeTransferETH: ETH transfer failed'); }
/** * @dev Internal accounting function for moving around L1 ETH. * * @param _to L1 address to transfer ETH to * @param _value Amount of ETH to send to */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 3849, 4106 ] }
3,533
OVM_L1ETHGateway
contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol
0x40c9067ec8087ecf101fc10d2673636955b81a32
Solidity
OVM_L1ETHGateway
contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver { /******************** * Public Constants * ********************/ uint32 public constant override getFinalizeDepositL2Gas = 1200000; /******************************** * External Contract References...
/** * @title OVM_L1ETHGateway * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2. * * Compiler used: solc * Runtime target: EVM */
NatSpecMultiLine
migrateEth
function migrateEth(address payable _to) external { address owner = Lib_AddressManager(libAddressManager).owner(); require(msg.sender == owner, "Only the owner can migrate ETH"); uint256 balance = address(this).balance; OVM_L1ETHGateway(_to).donateETH{value:balance}(); }
/** * @dev Migrates entire ETH balance to another gateway * @param _to Gateway Proxy address to migrate ETH to */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 4348, 4659 ] }
3,534
OVM_L1ETHGateway
contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol
0x40c9067ec8087ecf101fc10d2673636955b81a32
Solidity
OVM_L1ETHGateway
contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver { /******************** * Public Constants * ********************/ uint32 public constant override getFinalizeDepositL2Gas = 1200000; /******************************** * External Contract References...
/** * @title OVM_L1ETHGateway * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2. * * Compiler used: solc * Runtime target: EVM */
NatSpecMultiLine
donateETH
function donateETH() external payable {}
/** * @dev Adds ETH balance to the account. This is meant to allow for ETH * to be migrated from an old gateway to a new gateway */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 4812, 4856 ] }
3,535
SakeVoterCalc
contracts/SakeBar.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeBar
contract SakeBar is ERC20("SakeBar", "xSAKE"){ using SafeMath for uint256; IERC20 public sake; constructor(IERC20 _sake) public { require(address(_sake) != address(0), "invalid address"); sake = _sake; } // Enter the bar. Pay some SAKEs. Earn some shares. function ent...
enter
function enter(uint256 _amount) public { uint256 totalSake = sake.balanceOf(address(this)); uint256 totalShares = totalSupply(); if (totalShares == 0 || totalSake == 0) { _mint(msg.sender, _amount); } else { uint256 what = _amount.mul(totalShares).div(totalSake); _mint(msg...
// Enter the bar. Pay some SAKEs. Earn some shares.
LineComment
v0.6.12+commit.27d51765
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 304, 754 ] }
3,536
SakeVoterCalc
contracts/SakeBar.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeBar
contract SakeBar is ERC20("SakeBar", "xSAKE"){ using SafeMath for uint256; IERC20 public sake; constructor(IERC20 _sake) public { require(address(_sake) != address(0), "invalid address"); sake = _sake; } // Enter the bar. Pay some SAKEs. Earn some shares. function ent...
leave
function leave(uint256 _share) public { uint256 totalShares = totalSupply(); uint256 what = _share.mul(sake.balanceOf(address(this))).div(totalShares); _burn(msg.sender, _share); sake.transfer(msg.sender, what); }
// Leave the bar. Claim back your SAKEs.
LineComment
v0.6.12+commit.27d51765
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 803, 1062 ] }
3,537
UBURNSale
UBURNSale.sol
0x1f165586c4c57766971d11e7467dd5ebb153f16b
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ 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:...
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-solidity/pull/522 if (a == 0) { return 0; } uint2...
/** * @dev Multiplies two unsigned integers, reverts on overflow. */
NatSpecMultiLine
v0.6.8+commit.0bbfe453
MIT
ipfs://068e4e9849e8de16f01dd30c034edb4e4f1048bdf05fc41c943cf93b55816cfd
{ "func_code_index": [ 98, 496 ] }
3,538
UBURNSale
UBURNSale.sol
0x1f165586c4c57766971d11e7467dd5ebb153f16b
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ 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:...
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */
NatSpecMultiLine
v0.6.8+commit.0bbfe453
MIT
ipfs://068e4e9849e8de16f01dd30c034edb4e4f1048bdf05fc41c943cf93b55816cfd
{ "func_code_index": [ 618, 902 ] }
3,539
UBURNSale
UBURNSale.sol
0x1f165586c4c57766971d11e7467dd5ebb153f16b
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ 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:...
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; }
/** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.6.8+commit.0bbfe453
MIT
ipfs://068e4e9849e8de16f01dd30c034edb4e4f1048bdf05fc41c943cf93b55816cfd
{ "func_code_index": [ 1027, 1166 ] }
3,540
UBURNSale
UBURNSale.sol
0x1f165586c4c57766971d11e7467dd5ebb153f16b
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ 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:...
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; }
/** * @dev Adds two unsigned integers, reverts on overflow. */
NatSpecMultiLine
v0.6.8+commit.0bbfe453
MIT
ipfs://068e4e9849e8de16f01dd30c034edb4e4f1048bdf05fc41c943cf93b55816cfd
{ "func_code_index": [ 1241, 1380 ] }
3,541
UBURNSale
UBURNSale.sol
0x1f165586c4c57766971d11e7467dd5ebb153f16b
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ 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:...
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; }
/** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */
NatSpecMultiLine
v0.6.8+commit.0bbfe453
MIT
ipfs://068e4e9849e8de16f01dd30c034edb4e4f1048bdf05fc41c943cf93b55816cfd
{ "func_code_index": [ 1525, 1642 ] }
3,542
OVM_L1CrossDomainMessenger
contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol
0x598f2b19e983910529affab7d219724a019339cc
Solidity
OVM_L1CrossDomainMessenger
contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable { /********** * Events * **********/ event MessageBlocked( ...
/** * @title OVM_L1CrossDomainMessenger * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages * from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2 * epoch gas limit, it can be resubmitted via this contract's replay function. * ...
NatSpecMultiLine
initialize
function initialize( address _libAddressManager ) public initializer { require( address(libAddressManager) == address(0), "L1CrossDomainMessenger already intialized." ); libAddressManager = Lib_AddressManager(_libAddressManager); xDomainMsgSender = DEFAULT_XDOMAIN_SENDER; ...
/** * @param _libAddressManager Address of the Address Manager. */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 1634, 2261 ] }
3,543
OVM_L1CrossDomainMessenger
contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol
0x598f2b19e983910529affab7d219724a019339cc
Solidity
OVM_L1CrossDomainMessenger
contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable { /********** * Events * **********/ event MessageBlocked( ...
/** * @title OVM_L1CrossDomainMessenger * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages * from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2 * epoch gas limit, it can be resubmitted via this contract's replay function. * ...
NatSpecMultiLine
pause
function pause() external onlyOwner { _pause(); }
/** * Pause relaying. */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 2302, 2387 ] }
3,544
OVM_L1CrossDomainMessenger
contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol
0x598f2b19e983910529affab7d219724a019339cc
Solidity
OVM_L1CrossDomainMessenger
contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable { /********** * Events * **********/ event MessageBlocked( ...
/** * @title OVM_L1CrossDomainMessenger * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages * from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2 * epoch gas limit, it can be resubmitted via this contract's replay function. * ...
NatSpecMultiLine
blockMessage
function blockMessage( bytes32 _xDomainCalldataHash ) external onlyOwner { blockedMessages[_xDomainCalldataHash] = true; emit MessageBlocked(_xDomainCalldataHash); }
/** * Block a message. * @param _xDomainCalldataHash Hash of the message to block. */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 2494, 2715 ] }
3,545
OVM_L1CrossDomainMessenger
contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol
0x598f2b19e983910529affab7d219724a019339cc
Solidity
OVM_L1CrossDomainMessenger
contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable { /********** * Events * **********/ event MessageBlocked( ...
/** * @title OVM_L1CrossDomainMessenger * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages * from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2 * epoch gas limit, it can be resubmitted via this contract's replay function. * ...
NatSpecMultiLine
allowMessage
function allowMessage( bytes32 _xDomainCalldataHash ) external onlyOwner { blockedMessages[_xDomainCalldataHash] = false; emit MessageAllowed(_xDomainCalldataHash); }
/** * Allow a message. * @param _xDomainCalldataHash Hash of the message to block. */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 2822, 3044 ] }
3,546
OVM_L1CrossDomainMessenger
contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol
0x598f2b19e983910529affab7d219724a019339cc
Solidity
OVM_L1CrossDomainMessenger
contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable { /********** * Events * **********/ event MessageBlocked( ...
/** * @title OVM_L1CrossDomainMessenger * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages * from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2 * epoch gas limit, it can be resubmitted via this contract's replay function. * ...
NatSpecMultiLine
relayMessage
function relayMessage( address _target, address _sender, bytes memory _message, uint256 _messageNonce, L2MessageInclusionProof memory _proof ) override public nonReentrant onlyRelayer whenNotPaused { bytes memory xDomainCalldata = _getXDomainCalldata( _target, ...
/** * Relays a cross domain message to a contract. * @inheritdoc iOVM_L1CrossDomainMessenger */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 3161, 5103 ] }
3,547
OVM_L1CrossDomainMessenger
contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol
0x598f2b19e983910529affab7d219724a019339cc
Solidity
OVM_L1CrossDomainMessenger
contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable { /********** * Events * **********/ event MessageBlocked( ...
/** * @title OVM_L1CrossDomainMessenger * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages * from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2 * epoch gas limit, it can be resubmitted via this contract's replay function. * ...
NatSpecMultiLine
replayMessage
function replayMessage( address _target, address _sender, bytes memory _message, uint256 _messageNonce, uint32 _gasLimit ) override public { bytes memory xDomainCalldata = _getXDomainCalldata( _target, _sender, _message, _messageNonce ); require( ...
/** * Replays a cross domain message to the target messenger. * @inheritdoc iOVM_L1CrossDomainMessenger */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 5231, 5813 ] }
3,548
OVM_L1CrossDomainMessenger
contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol
0x598f2b19e983910529affab7d219724a019339cc
Solidity
OVM_L1CrossDomainMessenger
contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable { /********** * Events * **********/ event MessageBlocked( ...
/** * @title OVM_L1CrossDomainMessenger * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages * from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2 * epoch gas limit, it can be resubmitted via this contract's replay function. * ...
NatSpecMultiLine
_verifyXDomainMessage
function _verifyXDomainMessage( bytes memory _xDomainCalldata, L2MessageInclusionProof memory _proof ) internal view returns ( bool ) { return ( _verifyStateRootProof(_proof) && _verifyStorageProof(_xDomainCalldata, _proof) ); }
/** * Verifies that the given message is valid. * @param _xDomainCalldata Calldata to verify. * @param _proof Inclusion proof for the message. * @return Whether or not the provided message is valid. */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 6133, 6477 ] }
3,549
OVM_L1CrossDomainMessenger
contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol
0x598f2b19e983910529affab7d219724a019339cc
Solidity
OVM_L1CrossDomainMessenger
contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable { /********** * Events * **********/ event MessageBlocked( ...
/** * @title OVM_L1CrossDomainMessenger * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages * from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2 * epoch gas limit, it can be resubmitted via this contract's replay function. * ...
NatSpecMultiLine
_verifyStateRootProof
function _verifyStateRootProof( L2MessageInclusionProof memory _proof ) internal view returns ( bool ) { iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain( resolve("OVM_StateCommitmentChain") ); return ( ovmStateCommitmentChain.insideF...
/** * Verifies that the state root within an inclusion proof is valid. * @param _proof Message inclusion proof. * @return Whether or not the provided proof is valid. */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 6672, 7311 ] }
3,550
OVM_L1CrossDomainMessenger
contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol
0x598f2b19e983910529affab7d219724a019339cc
Solidity
OVM_L1CrossDomainMessenger
contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable { /********** * Events * **********/ event MessageBlocked( ...
/** * @title OVM_L1CrossDomainMessenger * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages * from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2 * epoch gas limit, it can be resubmitted via this contract's replay function. * ...
NatSpecMultiLine
_verifyStorageProof
function _verifyStorageProof( bytes memory _xDomainCalldata, L2MessageInclusionProof memory _proof ) internal view returns ( bool ) { bytes32 storageKey = keccak256( abi.encodePacked( keccak256( abi.encodePacked( _xDomainCalldat...
/** * Verifies that the storage proof within an inclusion proof is valid. * @param _xDomainCalldata Encoded message calldata. * @param _proof Message inclusion proof. * @return Whether or not the provided proof is valid. */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 7566, 8893 ] }
3,551
OVM_L1CrossDomainMessenger
contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol
0x598f2b19e983910529affab7d219724a019339cc
Solidity
OVM_L1CrossDomainMessenger
contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable { /********** * Events * **********/ event MessageBlocked( ...
/** * @title OVM_L1CrossDomainMessenger * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages * from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2 * epoch gas limit, it can be resubmitted via this contract's replay function. * ...
NatSpecMultiLine
_sendXDomainMessage
function _sendXDomainMessage( bytes memory _message, uint256 _gasLimit ) override internal { iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).enqueue( resolve("OVM_L2CrossDomainMessenger"), _gasLimit, _message ); }
/** * Sends a cross domain message. * @param _message Message to send. * @param _gasLimit OVM gas limit for the message. */
NatSpecMultiLine
v0.7.6+commit.7338295f
MIT
{ "func_code_index": [ 9043, 9381 ] }
3,552
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
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); /**...
/** * @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.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 94, 154 ] }
3,553
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
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); /**...
/** * @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.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 237, 310 ] }
3,554
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
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); /**...
/** * @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.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 534, 616 ] }
3,555
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
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); /**...
/** * @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.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 895, 983 ] }
3,556
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
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); /**...
/** * @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 ...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 1647, 1726 ] }
3,557
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
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); /**...
/** * @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.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 2039, 2141 ] }
3,558
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
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.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 259, 445 ] }
3,559
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 723, 864 ] }
3,560
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 1162, 1359 ] }
3,561
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 1613, 2089 ] }
3,562
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to reve...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 2560, 2697 ] }
3,563
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an in...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 3188, 3471 ] }
3,564
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consumi...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 3931, 4066 ] }
3,565
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcod...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 4546, 4717 ] }
3,566
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
isContract
function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codeha...
/** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: ...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 606, 1230 ] }
3,567
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
sendValue
function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address...
/** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `tr...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 2160, 2562 ] }
3,568
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); }
/** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw ...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 3318, 3496 ] }
3,569
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 3721, 3922 ] }
3,570
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ *...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 4292, 4523 ] }
3,571
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); }
/** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 4774, 5095 ] }
3,572
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
SafeERC20
library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, add...
/** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `...
NatSpecMultiLine
safeApprove
function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line ...
/** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 747, 1374 ] }
3,573
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
SafeERC20
library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, add...
/** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `...
NatSpecMultiLine
_callOptionalReturn
function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target ad...
/** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi...
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 2393, 3159 ] }
3,574
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
owner
function owner() public view returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 497, 581 ] }
3,575
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
renounceOwnership
function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); }
/** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 1139, 1292 ] }
3,576
ChadsLiquidityPool
ChadsLiquidityPool.sol
0x294ca5f24e1e9278072e398f607c8e60075ca574
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
/** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
None
ipfs://122f8e564f8722dd1cdb941da6c885f56b443ecf7e38d556ca7f3778725cc88c
{ "func_code_index": [ 1442, 1691 ] }
3,577
BondingShareV2
contracts/BondingV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingV2
contract BondingV2 is CollectableDust, Pausable { using SafeERC20 for IERC20; bytes public data = ""; UbiquityAlgorithmicDollarManager public manager; uint256 public constant ONE = uint256(1 ether); // 3Crv has 18 decimals uint256 public bondingDiscountMultiplier = uint256(1000000 gwei); // 0.001 ...
// solhint-disable-next-line no-empty-blocks
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 3422, 3455 ] }
3,578
BondingShareV2
contracts/BondingV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingV2
contract BondingV2 is CollectableDust, Pausable { using SafeERC20 for IERC20; bytes public data = ""; UbiquityAlgorithmicDollarManager public manager; uint256 public constant ONE = uint256(1 ether); // 3Crv has 18 decimals uint256 public bondingDiscountMultiplier = uint256(1000000 gwei); // 0.001 ...
addUserToMigrate
function addUserToMigrate( address _original, uint256 _lpBalance, uint256 _weeks ) external onlyMigrator { _toMigrateOriginals.push(_original); _toMigrateLpBalances.push(_lpBalance); totalLpToMigrate += _lpBalance; _toMigrateWeeks.push(_weeks); toMigrateId[_original] = _toMigrateOriginal...
/// @dev addUserToMigrate add a user to migrate from V1. /// IMPORTANT execute that function BEFORE sending the corresponding LP token /// otherwise they will have extra LP rewards /// @param _original address of v1 user /// @param _lpBalance LP Balance of v1 user /// @param _weeks weeks lockup of v1 user ///...
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 3849, 4224 ] }
3,579
BondingShareV2
contracts/BondingV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingV2
contract BondingV2 is CollectableDust, Pausable { using SafeERC20 for IERC20; bytes public data = ""; UbiquityAlgorithmicDollarManager public manager; uint256 public constant ONE = uint256(1 ether); // 3Crv has 18 decimals uint256 public bondingDiscountMultiplier = uint256(1000000 gwei); // 0.001 ...
uADPriceReset
function uADPriceReset(uint256 amount) external onlyBondingManager { IMetaPool metaPool = IMetaPool(manager.stableSwapMetaPoolAddress()); // remove one coin uint256 coinWithdrawn = metaPool.remove_liquidity_one_coin( amount, 0, 0 ); ITWAPOracle(manager.twapOracleAddress()).up...
/// @dev uADPriceReset remove uAD unilateraly from the curve LP share sitting inside /// the bonding contract and send the uAD received to the treasury. /// This will have the immediate effect of pushing the uAD price HIGHER /// @param amount of LP token to be removed for uAD /// @notice it will remove one co...
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 4841, 5580 ] }
3,580
BondingShareV2
contracts/BondingV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingV2
contract BondingV2 is CollectableDust, Pausable { using SafeERC20 for IERC20; bytes public data = ""; UbiquityAlgorithmicDollarManager public manager; uint256 public constant ONE = uint256(1 ether); // 3Crv has 18 decimals uint256 public bondingDiscountMultiplier = uint256(1000000 gwei); // 0.001 ...
crvPriceReset
function crvPriceReset(uint256 amount) external onlyBondingManager { IMetaPool metaPool = IMetaPool(manager.stableSwapMetaPoolAddress()); // remove one coin uint256 coinWithdrawn = metaPool.remove_liquidity_one_coin( amount, 1, 0 ); // update twap ITWAPOracle(manager.twap...
/// @dev crvPriceReset remove 3CRV unilateraly from the curve LP share sitting inside /// the bonding contract and send the 3CRV received to the treasury /// This will have the immediate effect of pushing the uAD price LOWER /// @param amount of LP token to be removed for 3CRV tokens /// @notice it will remov...
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 5994, 6768 ] }
3,581
BondingShareV2
contracts/BondingV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingV2
contract BondingV2 is CollectableDust, Pausable { using SafeERC20 for IERC20; bytes public data = ""; UbiquityAlgorithmicDollarManager public manager; uint256 public constant ONE = uint256(1 ether); // 3Crv has 18 decimals uint256 public bondingDiscountMultiplier = uint256(1000000 gwei); // 0.001 ...
addProtocolToken
function addProtocolToken(address _token) external override onlyBondingManager { _addProtocolToken(_token); }
/// Collectable Dust
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 6982, 7135 ] }
3,582
BondingShareV2
contracts/BondingV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingV2
contract BondingV2 is CollectableDust, Pausable { using SafeERC20 for IERC20; bytes public data = ""; UbiquityAlgorithmicDollarManager public manager; uint256 public constant ONE = uint256(1 ether); // 3Crv has 18 decimals uint256 public bondingDiscountMultiplier = uint256(1000000 gwei); // 0.001 ...
deposit
function deposit(uint256 _lpsAmount, uint256 _weeks) external whenNotPaused returns (uint256 _id) { require( 1 <= _weeks && _weeks <= 208, "Bonding: duration must be between 1 and 208 weeks" ); ITWAPOracle(manager.twapOracleAddress()).update(); // update the accumulated lp r...
/// @dev deposit uAD-3CRV LP tokens for a duration to receive bonding shares /// @param _lpsAmount of LP token to send /// @param _weeks during lp token will be held /// @notice weeks act as a multiplier for the amount of bonding shares to be received
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 8251, 9670 ] }
3,583
BondingShareV2
contracts/BondingV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingV2
contract BondingV2 is CollectableDust, Pausable { using SafeERC20 for IERC20; bytes public data = ""; UbiquityAlgorithmicDollarManager public manager; uint256 public constant ONE = uint256(1 ether); // 3Crv has 18 decimals uint256 public bondingDiscountMultiplier = uint256(1000000 gwei); // 0.001 ...
addLiquidity
function addLiquidity( uint256 _amount, uint256 _id, uint256 _weeks ) external whenNotPaused { ( uint256[2] memory bs, BondingShareV2.Bond memory bond ) = _checkForLiquidity(_id); // calculate pending LP rewards uint256 sharesToRemove = bs[0]; _updateLpPerShare(); ui...
/// @dev Add an amount of uAD-3CRV LP tokens /// @param _amount of LP token to deposit /// @param _id bonding shares id /// @param _weeks during lp token will be held /// @notice bonding shares are ERC1155 (aka NFT) because they have an expiration date
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 9945, 12394 ] }
3,584
BondingShareV2
contracts/BondingV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingV2
contract BondingV2 is CollectableDust, Pausable { using SafeERC20 for IERC20; bytes public data = ""; UbiquityAlgorithmicDollarManager public manager; uint256 public constant ONE = uint256(1 ether); // 3Crv has 18 decimals uint256 public bondingDiscountMultiplier = uint256(1000000 gwei); // 0.001 ...
removeLiquidity
function removeLiquidity(uint256 _amount, uint256 _id) external whenNotPaused { ( uint256[2] memory bs, BondingShareV2.Bond memory bond ) = _checkForLiquidity(_id); require(bond.lpAmount >= _amount, "Bonding: amount too big"); // we should decrease the UBQ rewards proportionally ...
/// @dev Remove an amount of uAD-3CRV LP tokens /// @param _amount of LP token deposited when _id was created to be withdrawn /// @param _id bonding shares id /// @notice bonding shares are ERC1155 (aka NFT) because they have an expiration date
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 12657, 15390 ] }
3,585
BondingShareV2
contracts/BondingV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingV2
contract BondingV2 is CollectableDust, Pausable { using SafeERC20 for IERC20; bytes public data = ""; UbiquityAlgorithmicDollarManager public manager; uint256 public constant ONE = uint256(1 ether); // 3Crv has 18 decimals uint256 public bondingDiscountMultiplier = uint256(1000000 gwei); // 0.001 ...
pendingLpRewards
function pendingLpRewards(uint256 _id) external view returns (uint256) { BondingShareV2 bonding = BondingShareV2(manager.bondingShareAddress()); BondingShareV2.Bond memory bond = bonding.getBond(_id); uint256[2] memory bs = IMasterChefV2(manager.masterChefAddress()) .getBondingShareInfo(_id); u...
// View function to see pending lpRewards on frontend.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 15451, 16962 ] }
3,586
BondingShareV2
contracts/BondingV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingV2
contract BondingV2 is CollectableDust, Pausable { using SafeERC20 for IERC20; bytes public data = ""; UbiquityAlgorithmicDollarManager public manager; uint256 public constant ONE = uint256(1 ether); // 3Crv has 18 decimals uint256 public bondingDiscountMultiplier = uint256(1000000 gwei); // 0.001 ...
migrate
function migrate() public whenMigrating returns (uint256 _id) { _id = toMigrateId[msg.sender]; require(_id > 0, "not v1 address"); _migrate( _toMigrateOriginals[_id - 1], _toMigrateLpBalances[_id - 1], _toMigrateWeeks[_id - 1] ); }
/// @dev migrate let a user migrate from V1 /// @notice user will then be able to migrate
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 17214, 17522 ] }
3,587
BondingShareV2
contracts/BondingV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingV2
contract BondingV2 is CollectableDust, Pausable { using SafeERC20 for IERC20; bytes public data = ""; UbiquityAlgorithmicDollarManager public manager; uint256 public constant ONE = uint256(1 ether); // 3Crv has 18 decimals uint256 public bondingDiscountMultiplier = uint256(1000000 gwei); // 0.001 ...
lpRewardForShares
function lpRewardForShares(uint256 amount, uint256 lpRewardDebt) public view returns (uint256 pendingLpReward) { if (accLpRewardPerShare > 0) { pendingLpReward = (amount * accLpRewardPerShare) / 1e12 - (lpRewardDebt); } }
/// @dev return the amount of Lp token rewards an amount of shares entitled /// @param amount of bonding shares /// @param lpRewardDebt lp rewards that has already been distributed
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 17717, 18050 ] }
3,588
BondingShareV2
contracts/BondingV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingV2
contract BondingV2 is CollectableDust, Pausable { using SafeERC20 for IERC20; bytes public data = ""; UbiquityAlgorithmicDollarManager public manager; uint256 public constant ONE = uint256(1 ether); // 3Crv has 18 decimals uint256 public bondingDiscountMultiplier = uint256(1000000 gwei); // 0.001 ...
_migrate
function _migrate( address user, uint256 _lpsAmount, uint256 _weeks ) internal returns (uint256 _id) { require(toMigrateId[user] > 0, "not v1 address"); require(_lpsAmount > 0, "LP amount is zero"); require( 1 <= _weeks && _weeks <= 208, "Duration must be between 1 and 208 weeks"...
/// @dev migrate let a user migrate from V1 /// @notice user will then be able to migrate
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 18578, 19949 ] }
3,589
BondingShareV2
contracts/BondingV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingV2
contract BondingV2 is CollectableDust, Pausable { using SafeERC20 for IERC20; bytes public data = ""; UbiquityAlgorithmicDollarManager public manager; uint256 public constant ONE = uint256(1 ether); // 3Crv has 18 decimals uint256 public bondingDiscountMultiplier = uint256(1000000 gwei); // 0.001 ...
_updateLpPerShare
function _updateLpPerShare() internal { BondingShareV2 bond = BondingShareV2(manager.bondingShareAddress()); uint256 lpBalance = IERC20(manager.stableSwapMetaPoolAddress()) .balanceOf(address(this)); // the excess LP is the current balance // minus the total deposited LP + LP that needs to be mi...
/// @dev update the accumulated excess LP per share
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 20007, 21139 ] }
3,590
XI
XI.sol
0x51909adff69f3b82cffbaf93ed668566764ca233
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * ...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; }
/** * @dev Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2358acac06dd1bd3eb423be2fab1e488a0c544c83d57b2621589a2c03d205774
{ "func_code_index": [ 95, 302 ] }
3,591
XI
XI.sol
0x51909adff69f3b82cffbaf93ed668566764ca233
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * ...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; }
/** * @dev Integer division of two numbers, truncating the quotient. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2358acac06dd1bd3eb423be2fab1e488a0c544c83d57b2621589a2c03d205774
{ "func_code_index": [ 392, 692 ] }
3,592
XI
XI.sol
0x51909adff69f3b82cffbaf93ed668566764ca233
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * ...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
/** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2358acac06dd1bd3eb423be2fab1e488a0c544c83d57b2621589a2c03d205774
{ "func_code_index": [ 812, 940 ] }
3,593
XI
XI.sol
0x51909adff69f3b82cffbaf93ed668566764ca233
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * ...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; }
/** * @dev Adds two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2358acac06dd1bd3eb423be2fab1e488a0c544c83d57b2621589a2c03d205774
{ "func_code_index": [ 1010, 1156 ] }
3,594
DssSpell
DssSpell.sol
0xd155716c72edcd14ffb60131f83b3ef4d34aa201
Solidity
DssSpell
contract DssSpell { DSPauseAbstract public pause = DSPauseAbstract(0xbE286431454714F511008713973d3B053A2d38f3); address public action; bytes32 public tag; uint256 public eta; bytes public sig; uint256 public expiration; bool ...
schedule
function schedule() public { require(now <= expiration, "This contract has expired"); require(eta == 0, "This spell has already been scheduled"); eta = now + DSPauseAbstract(pause).delay(); pause.plot(action, tag, sig, eta); }
// modifier officeHours { // uint day = (now / 1 days + 3) % 7; // require(day < 5, "Can only be cast on a weekday"); // uint hour = now / 1 hours % 24; // require(hour >= 14 && hour < 21, "Outside office hours"); // _; // }
LineComment
v0.5.12+commit.7709ece9
Unknown
bzzr://0e6287828387b71b1fb5f7eb80a06b6c4287498cdb2c47889a51e736d460f9c3
{ "func_code_index": [ 1441, 1713 ] }
3,595
BurnBase
BurnBase.sol
0x3ad1ed0ac57533d228c0c1971ea6749d98dea815
Solidity
BurnBase
contract BurnBase is ERC20Detailed { using SafeMath for uint256; ERC20Detailed internal WETH = ERC20Detailed(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); IUniswapV2Factory public uniswapFactory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); mapping (address => uint256) p...
burnOnOff
function burnOnOff() external onlyOwner { if(basePercentage == 0) basePercentage = 1000; else basePercentage = 0;
//turns burn on/off called by owner only
LineComment
v0.5.17+commit.d19bba13
None
bzzr://a0235a3da77c791ed26ee9d71cb3768db376a71927b29f1fe133e7a269f4f89b
{ "func_code_index": [ 2782, 2941 ] }
3,596
BurnBase
BurnBase.sol
0x3ad1ed0ac57533d228c0c1971ea6749d98dea815
Solidity
BurnBase
contract BurnBase is ERC20Detailed { using SafeMath for uint256; ERC20Detailed internal WETH = ERC20Detailed(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); IUniswapV2Factory public uniswapFactory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); mapping (address => uint256) p...
burn
function burn(uint256 amount) external { _burn(msg.sender, amount); }
//burn
LineComment
v0.5.17+commit.d19bba13
None
bzzr://a0235a3da77c791ed26ee9d71cb3768db376a71927b29f1fe133e7a269f4f89b
{ "func_code_index": [ 2962, 3062 ] }
3,597
BurnBase
BurnBase.sol
0x3ad1ed0ac57533d228c0c1971ea6749d98dea815
Solidity
BurnBase
contract BurnBase is ERC20Detailed { using SafeMath for uint256; ERC20Detailed internal WETH = ERC20Detailed(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); IUniswapV2Factory public uniswapFactory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); mapping (address => uint256) p...
multiTransferEqualAmount
function multiTransferEqualAmount(address[] memory receivers, uint256 amount) public { uint256 amountWithDecimals = amount * 10**uint256(tokenDecimals); for (uint256 i = 0; i < receivers.length; i++) { transfer(receivers[i], amountWithDecimals); } }
//no zeros for decimals necessary
LineComment
v0.5.17+commit.d19bba13
None
bzzr://a0235a3da77c791ed26ee9d71cb3768db376a71927b29f1fe133e7a269f4f89b
{ "func_code_index": [ 3486, 3765 ] }
3,598
BurnBase
BurnBase.sol
0x3ad1ed0ac57533d228c0c1971ea6749d98dea815
Solidity
BurnBase
contract BurnBase is ERC20Detailed { using SafeMath for uint256; ERC20Detailed internal WETH = ERC20Detailed(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); IUniswapV2Factory public uniswapFactory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); mapping (address => uint256) p...
setPairAddress
function setPairAddress() external onlyOwner { _pairAddress = uniswapFactory.getPair(address(WETH), address(this)); }
//_pairAddress
LineComment
v0.5.17+commit.d19bba13
None
bzzr://a0235a3da77c791ed26ee9d71cb3768db376a71927b29f1fe133e7a269f4f89b
{ "func_code_index": [ 4688, 4830 ] }
3,599
BurnBase
BurnBase.sol
0x3ad1ed0ac57533d228c0c1971ea6749d98dea815
Solidity
BurnBase
contract BurnBase is ERC20Detailed { using SafeMath for uint256; ERC20Detailed internal WETH = ERC20Detailed(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); IUniswapV2Factory public uniswapFactory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); mapping (address => uint256) p...
withdrawUnclaimedTokens
function withdrawUnclaimedTokens(address contractUnclaimed) external onlyOwner { currentToken = IERC20(contractUnclaimed); uint256 amount = currentToken.balanceOf(address(this)); currentToken.transfer(_owner, amount); }
//take back unclaimed tokens
LineComment
v0.5.17+commit.d19bba13
None
bzzr://a0235a3da77c791ed26ee9d71cb3768db376a71927b29f1fe133e7a269f4f89b
{ "func_code_index": [ 4878, 5146 ] }
3,600
BurnBase
BurnBase.sol
0x3ad1ed0ac57533d228c0c1971ea6749d98dea815
Solidity
BurnBase
contract BurnBase is ERC20Detailed { using SafeMath for uint256; ERC20Detailed internal WETH = ERC20Detailed(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); IUniswapV2Factory public uniswapFactory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); mapping (address => uint256) p...
_executeTransfer
function _executeTransfer(address _from, address _to, uint256 _value) private { if (_to == address(0)) revert(); // Prevent transfer to 0x0 address. Use burn() instead if (_value <= 0) revert(); if (_balances[_from] < _value) revert(); // Check if the sender has eno...
// transfer
LineComment
v0.5.17+commit.d19bba13
None
bzzr://a0235a3da77c791ed26ee9d71cb3768db376a71927b29f1fe133e7a269f4f89b
{ "func_code_index": [ 5188, 7067 ] }
3,601
FSK
FSK.sol
0xfc1078a7bb4521881663df4148434acd991af14c
Solidity
Ownable
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.se...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://c1365d92e730965b8fe1b4509be387df4ed648522029f0d8aa5202e89110dc5b
{ "func_code_index": [ 673, 870 ] }
3,602
FSK
FSK.sol
0xfc1078a7bb4521881663df4148434acd991af14c
Solidity
BasicToken
contract BasicToken is ERC20Basic, Ownable { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(addre...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
transfer
function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balanceOf(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_v...
/** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://c1365d92e730965b8fe1b4509be387df4ed648522029f0d8aa5202e89110dc5b
{ "func_code_index": [ 293, 722 ] }
3,603
FSK
FSK.sol
0xfc1078a7bb4521881663df4148434acd991af14c
Solidity
BasicToken
contract BasicToken is ERC20Basic, Ownable { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(addre...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
balanceOf
function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; }
/** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://c1365d92e730965b8fe1b4509be387df4ed648522029f0d8aa5202e89110dc5b
{ "func_code_index": [ 939, 1059 ] }
3,604
FSK
FSK.sol
0xfc1078a7bb4521881663df4148434acd991af14c
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer t...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(allowed[_from][msg.sender] >= _value); require(balanceOf(_from) >= _value); require(balances[_to].add(_value) > balances[_to]); // Check for overflows balances[_from] = ...
/** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://c1365d92e730965b8fe1b4509be387df4ed648522029f0d8aa5202e89110dc5b
{ "func_code_index": [ 399, 975 ] }
3,605
FSK
FSK.sol
0xfc1078a7bb4521881663df4148434acd991af14c
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer t...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
approve
function approve(address _spender, uint256 _value) public returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/...
/** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://c1365d92e730965b8fe1b4509be387df4ed648522029f0d8aa5202e89110dc5b
{ "func_code_index": [ 1217, 1809 ] }
3,606