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
Timelock
@openzeppelin/contracts/math/SafeMath.sol
0x5afedef12b556bd7deb056dd2aba5e084a5a0c2f
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) { uint256 c = a + b; if (c < a) return (false, 0); r...
/** * @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) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://f306e547a554f3783f677542a35ad719674495db1d7a807923393667c52ecb7e
{ "func_code_index": [ 2585, 2748 ] }
3,107
Timelock
@openzeppelin/contracts/math/SafeMath.sol
0x5afedef12b556bd7deb056dd2aba5e084a5a0c2f
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) { uint256 c = a + b; if (c < a) return (false, 0); r...
/** * @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) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; }
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://f306e547a554f3783f677542a35ad719674495db1d7a807923393667c52ecb7e
{ "func_code_index": [ 3002, 3227 ] }
3,108
Timelock
@openzeppelin/contracts/math/SafeMath.sol
0x5afedef12b556bd7deb056dd2aba5e084a5a0c2f
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) { uint256 c = a + b; if (c < a) return (false, 0); r...
/** * @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) { require(b > 0, "SafeMath: division by zero"); 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. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to re...
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://f306e547a554f3783f677542a35ad719674495db1d7a807923393667c52ecb7e
{ "func_code_index": [ 3700, 3858 ] }
3,109
Timelock
@openzeppelin/contracts/math/SafeMath.sol
0x5afedef12b556bd7deb056dd2aba5e084a5a0c2f
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) { uint256 c = a + b; if (c < a) return (false, 0); r...
/** * @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) { require(b > 0, "SafeMath: modulo by zero"); 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.6.12+commit.27d51765
None
ipfs://f306e547a554f3783f677542a35ad719674495db1d7a807923393667c52ecb7e
{ "func_code_index": [ 4320, 4476 ] }
3,110
Timelock
@openzeppelin/contracts/math/SafeMath.sol
0x5afedef12b556bd7deb056dd2aba5e084a5a0c2f
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) { uint256 c = a + b; if (c < a) return (false, 0); r...
/** * @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); 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.6.12+commit.27d51765
None
ipfs://f306e547a554f3783f677542a35ad719674495db1d7a807923393667c52ecb7e
{ "func_code_index": [ 4950, 5121 ] }
3,111
Timelock
@openzeppelin/contracts/math/SafeMath.sol
0x5afedef12b556bd7deb056dd2aba5e084a5a0c2f
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) { uint256 c = a + b; if (c < a) return (false, 0); r...
/** * @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); 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. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv...
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://f306e547a554f3783f677542a35ad719674495db1d7a807923393667c52ecb7e
{ "func_code_index": [ 5790, 5960 ] }
3,112
Timelock
@openzeppelin/contracts/math/SafeMath.sol
0x5afedef12b556bd7deb056dd2aba5e084a5a0c2f
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) { uint256 c = a + b; if (c < a) return (false, 0); r...
/** * @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), * 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.6.12+commit.27d51765
None
ipfs://f306e547a554f3783f677542a35ad719674495db1d7a807923393667c52ecb7e
{ "func_code_index": [ 6618, 6788 ] }
3,113
AaveMonitorV2
contracts/aaveV2/saver/AaveSaverReceiverV2.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
AaveSaverReceiverV2
contract AaveSaverReceiverV2 is AaveHelperV2, AdminAuth, DFSExchangeData { using SafeERC20 for ERC20; address public constant AAVE_SAVER_PROXY = 0xBBCD23145Ab10C369c9e5D3b1D58506B0cD2ab44; address public constant AAVE_BASIC_PROXY = 0xc17c8eB12Ba24D62E69fd57cbd504EEf418867f9; address public constant AE...
/// @title Import Aave position from account to wallet
NatSpecSingleLine
/// @dev if contract receive eth, convert it to WETH
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 2685, 2885 ] }
3,114
AaveMonitorV2
contracts/reflexer/saver/RAISaverProxyHelper.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverProxyHelper
contract RAISaverProxyHelper is DSMath { enum ManagerType { RAI } /// @notice Returns a normalized debt _amount based on the current rate /// @param _amount Amount of dai to be normalized /// @param _rate Current rate of the stability fee /// @param _daiVatBalance Balance od Dai in the Vat for tha...
/// @title Helper methods for RAISaverProxy
NatSpecSingleLine
normalizeDrawAmount
function normalizeDrawAmount(uint _amount, uint _rate, uint _daiVatBalance) internal pure returns (int dart) { if (_daiVatBalance < mul(_amount, RAY)) { dart = toPositiveInt(sub(mul(_amount, RAY), _daiVatBalance) / _rate); dart = mul(uint(dart), _rate) < mul(_amount, RAY) ? dart + 1 : dart; } }
/// @notice Returns a normalized debt _amount based on the current rate /// @param _amount Amount of dai to be normalized /// @param _rate Current rate of the stability fee /// @param _daiVatBalance Balance od Dai in the Vat for that Safe
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 327, 670 ] }
3,115
AaveMonitorV2
contracts/reflexer/saver/RAISaverProxyHelper.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverProxyHelper
contract RAISaverProxyHelper is DSMath { enum ManagerType { RAI } /// @notice Returns a normalized debt _amount based on the current rate /// @param _amount Amount of dai to be normalized /// @param _rate Current rate of the stability fee /// @param _daiVatBalance Balance od Dai in the Vat for tha...
/// @title Helper methods for RAISaverProxy
NatSpecSingleLine
toRad
function toRad(uint _wad) internal pure returns (uint) { return mul(_wad, 10 ** 27); }
/// @notice Converts a number to Rad percision /// @param _wad The input number in wad percision
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 777, 879 ] }
3,116
AaveMonitorV2
contracts/reflexer/saver/RAISaverProxyHelper.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverProxyHelper
contract RAISaverProxyHelper is DSMath { enum ManagerType { RAI } /// @notice Returns a normalized debt _amount based on the current rate /// @param _amount Amount of dai to be normalized /// @param _rate Current rate of the stability fee /// @param _daiVatBalance Balance od Dai in the Vat for tha...
/// @title Helper methods for RAISaverProxy
NatSpecSingleLine
convertTo18
function convertTo18(address _joinAddr, uint256 _amount) internal view returns (uint256) { return mul(_amount, 10 ** (18 - IBasicTokenAdapters(_joinAddr).decimals())); }
/// @notice Converts a number to 18 decimal percision /// @param _joinAddr Join address of the collateral /// @param _amount Number to be converted
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 1041, 1226 ] }
3,117
AaveMonitorV2
contracts/reflexer/saver/RAISaverProxyHelper.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverProxyHelper
contract RAISaverProxyHelper is DSMath { enum ManagerType { RAI } /// @notice Returns a normalized debt _amount based on the current rate /// @param _amount Amount of dai to be normalized /// @param _rate Current rate of the stability fee /// @param _daiVatBalance Balance od Dai in the Vat for tha...
/// @title Helper methods for RAISaverProxy
NatSpecSingleLine
toPositiveInt
function toPositiveInt(uint _x) internal pure returns (int y) { y = int(_x); require(y >= 0, "int-overflow"); }
/// @notice Converts a uint to int and checks if positive /// @param _x Number to be converted
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 1331, 1466 ] }
3,118
AaveMonitorV2
contracts/reflexer/saver/RAISaverProxyHelper.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverProxyHelper
contract RAISaverProxyHelper is DSMath { enum ManagerType { RAI } /// @notice Returns a normalized debt _amount based on the current rate /// @param _amount Amount of dai to be normalized /// @param _rate Current rate of the stability fee /// @param _daiVatBalance Balance od Dai in the Vat for tha...
/// @title Helper methods for RAISaverProxy
NatSpecSingleLine
normalizePaybackAmount
function normalizePaybackAmount(address _safeEngine, address _urn, bytes32 _collType) internal view returns (int amount) { uint dai = ISAFEEngine(_safeEngine).coinBalance(_urn); (, uint rate,,,,) = ISAFEEngine(_safeEngine).collateralTypes(_collType); (, uint art) = ISAFEEngine(_safeEngine).safes(_collType,...
/// @notice Gets Dai amount in Vat which can be added to Safe /// @param _safeEngine Address of Vat contract /// @param _urn Urn of the Safe /// @param _collType CollType of the Safe
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 1667, 2133 ] }
3,119
AaveMonitorV2
contracts/reflexer/saver/RAISaverProxyHelper.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverProxyHelper
contract RAISaverProxyHelper is DSMath { enum ManagerType { RAI } /// @notice Returns a normalized debt _amount based on the current rate /// @param _amount Amount of dai to be normalized /// @param _rate Current rate of the stability fee /// @param _daiVatBalance Balance od Dai in the Vat for tha...
/// @title Helper methods for RAISaverProxy
NatSpecSingleLine
_getGeneratedDeltaDebt
function _getGeneratedDeltaDebt( address safeEngine, address taxCollector, address safeHandler, bytes32 collateralType, uint wad ) internal returns (int deltaDebt) { // Updates stability fee rate uint rate = ITaxCollector(taxCollector).taxSingle(collateralType); require(rate > 0, "invali...
/// @notice Gets delta debt generated (Total Safe debt minus available safeHandler COIN balance) /// @param safeEngine address /// @param taxCollector address /// @param safeHandler address /// @param collateralType bytes32 /// @return deltaDebt
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 2405, 3524 ] }
3,120
AaveMonitorV2
contracts/reflexer/saver/RAISaverProxyHelper.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverProxyHelper
contract RAISaverProxyHelper is DSMath { enum ManagerType { RAI } /// @notice Returns a normalized debt _amount based on the current rate /// @param _amount Amount of dai to be normalized /// @param _rate Current rate of the stability fee /// @param _daiVatBalance Balance od Dai in the Vat for tha...
/// @title Helper methods for RAISaverProxy
NatSpecSingleLine
getAllDebt
function getAllDebt(address _safeEngine, address _usr, address _urn, bytes32 _collType) internal view returns (uint daiAmount) { (, uint rate,,,,) = ISAFEEngine(_safeEngine).collateralTypes(_collType); (, uint art) = ISAFEEngine(_safeEngine).safes(_collType, _urn); uint dai = ISAFEEngine(_safeEngine).coinBa...
/// @notice Gets the whole debt of the Safe /// @param _safeEngine Address of Vat contract /// @param _usr Address of the Dai holder /// @param _urn Urn of the Safe /// @param _collType CollType of the Safe
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 4615, 5122 ] }
3,121
AaveMonitorV2
contracts/reflexer/saver/RAISaverProxyHelper.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverProxyHelper
contract RAISaverProxyHelper is DSMath { enum ManagerType { RAI } /// @notice Returns a normalized debt _amount based on the current rate /// @param _amount Amount of dai to be normalized /// @param _rate Current rate of the stability fee /// @param _daiVatBalance Balance od Dai in the Vat for tha...
/// @title Helper methods for RAISaverProxy
NatSpecSingleLine
getCollateralAddr
function getCollateralAddr(address _joinAddr) internal view returns (address) { return address(IBasicTokenAdapters(_joinAddr).collateral()); }
/// @notice Gets the token address from the Join contract /// @param _joinAddr Address of the Join contract
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 5240, 5398 ] }
3,122
AaveMonitorV2
contracts/reflexer/saver/RAISaverProxyHelper.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverProxyHelper
contract RAISaverProxyHelper is DSMath { enum ManagerType { RAI } /// @notice Returns a normalized debt _amount based on the current rate /// @param _amount Amount of dai to be normalized /// @param _rate Current rate of the stability fee /// @param _daiVatBalance Balance od Dai in the Vat for tha...
/// @title Helper methods for RAISaverProxy
NatSpecSingleLine
isEthJoinAddr
function isEthJoinAddr(address _joinAddr) internal view returns (bool) { // if it's dai_join_addr don't check gem() it will fail if (_joinAddr == 0x0A5653CCa4DB1B6E265F47CAf6969e64f1CFdC45) return false; // if coll is weth it's and eth type coll if (address(IBasicTokenAdapters(_joinAddr).collateral()) ...
/// @notice Checks if the join address is one of the Ether coll. types /// @param _joinAddr Join address to check
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 5522, 5974 ] }
3,123
AaveMonitorV2
contracts/reflexer/saver/RAISaverProxyHelper.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverProxyHelper
contract RAISaverProxyHelper is DSMath { enum ManagerType { RAI } /// @notice Returns a normalized debt _amount based on the current rate /// @param _amount Amount of dai to be normalized /// @param _rate Current rate of the stability fee /// @param _daiVatBalance Balance od Dai in the Vat for tha...
/// @title Helper methods for RAISaverProxy
NatSpecSingleLine
getSafeInfo
function getSafeInfo(ISAFEManager _manager, uint _safeId, bytes32 _collType) public view returns (uint, uint) { address vat = _manager.safeEngine(); address urn = _manager.safes(_safeId); (uint collateral, uint debt) = ISAFEEngine(vat).safes(_collType, urn); (,uint rate,,,,) = ISAFEEngine(vat).collater...
/// @notice Gets Safe info (collateral, debt) /// @param _manager Manager contract /// @param _safeId Id of the Safe /// @param _collType CollType of the Safe
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 6151, 6564 ] }
3,124
AaveMonitorV2
contracts/reflexer/saver/RAISaverProxyHelper.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverProxyHelper
contract RAISaverProxyHelper is DSMath { enum ManagerType { RAI } /// @notice Returns a normalized debt _amount based on the current rate /// @param _amount Amount of dai to be normalized /// @param _rate Current rate of the stability fee /// @param _daiVatBalance Balance od Dai in the Vat for tha...
/// @title Helper methods for RAISaverProxy
NatSpecSingleLine
getOwner
function getOwner(ISAFEManager _manager, uint _safeId) public view returns (address) { DSProxy proxy = DSProxy(uint160(_manager.ownsSAFE(_safeId))); return proxy.owner(); }
/// @notice Address that owns the DSProxy that owns the Safe /// @param _manager Manager contract /// @param _safeId Id of the Safe
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 6710, 6907 ] }
3,125
AaveMonitorV2
contracts/reflexer/saver/RAISaverProxyHelper.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverProxyHelper
contract RAISaverProxyHelper is DSMath { enum ManagerType { RAI } /// @notice Returns a normalized debt _amount based on the current rate /// @param _amount Amount of dai to be normalized /// @param _rate Current rate of the stability fee /// @param _daiVatBalance Balance od Dai in the Vat for tha...
/// @title Helper methods for RAISaverProxy
NatSpecSingleLine
getManagerAddr
function getManagerAddr(ManagerType _managerType) public pure returns (address) { if (_managerType == ManagerType.RAI) { return 0xEfe0B4cA532769a3AE758fD82E1426a03A94F185; } }
/// @notice Based on the manager type returns the address /// @param _managerType Type of vault manager to use
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 7028, 7239 ] }
3,126
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
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.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 94, 154 ] }
3,127
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
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.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 237, 310 ] }
3,128
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
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.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 534, 616 ] }
3,129
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
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.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 895, 983 ] }
3,130
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
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.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 1647, 1726 ] }
3,131
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
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.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 2039, 2141 ] }
3,132
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
name
function name() public view virtual returns (string memory) { return _name; }
/** * @dev Returns the name of the token. */
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 765, 861 ] }
3,133
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
symbol
function symbol() public view virtual returns (string memory) { return _symbol; }
/** * @dev Returns the symbol of the token, usually a shorter version of the * name. */
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 975, 1075 ] }
3,134
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
decimals
function decimals() public view virtual returns (uint8) { return 18; }
/** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is...
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 1709, 1798 ] }
3,135
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
totalSupply
function totalSupply() public view virtual override returns (uint256) { return _totalSupply; }
/** * @dev See {IERC20-totalSupply}. */
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 1858, 1971 ] }
3,136
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
balanceOf
function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; }
/** * @dev See {IERC20-balanceOf}. */
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 2029, 2161 ] }
3,137
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
transfer
function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
/** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 2369, 2549 ] }
3,138
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
allowance
function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {IERC20-allowance}. */
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 2607, 2763 ] }
3,139
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
approve
function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 2905, 3079 ] }
3,140
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _ap...
/** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `...
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 3556, 3983 ] }
3,141
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; }
/** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 4387, 4607 ] }
3,142
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - sub...
/** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 5105, 5487 ] }
3,143
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
_transfer
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 sende...
/** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. *...
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 5972, 6581 ] }
3,144
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
_mint
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); }
/** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 6858, 7201 ] }
3,145
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
_burn
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds ba...
/** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 7529, 8028 ] }
3,146
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
_approve
function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amoun...
/** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero a...
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 8461, 8812 ] }
3,147
MarsCoin
MarsCoin.sol
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
Solidity
ERC20
contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {sy...
_beforeTokenTransfer
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
/** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * -...
NatSpecMultiLine
v0.8.1+commit.df193b15
None
ipfs://099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd80
{ "func_code_index": [ 9410, 9507 ] }
3,148
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
Solidity
IERC20
interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipi...
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 165, 238 ] }
3,149
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
Solidity
IERC20
interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipi...
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 462, 544 ] }
3,150
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
Solidity
IERC20
interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipi...
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 823, 911 ] }
3,151
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
Solidity
IERC20
interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipi...
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 1575, 1654 ] }
3,152
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
Solidity
IERC20
interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipi...
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 1967, 2069 ] }
3,153
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 259, 445 ] }
3,154
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 723, 864 ] }
3,155
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 1162, 1359 ] }
3,156
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 1613, 2089 ] }
3,157
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 2560, 2697 ] }
3,158
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 3188, 3471 ] }
3,159
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 3931, 4066 ] }
3,160
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 4546, 4717 ] }
3,161
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
Solidity
Context
abstract contract Context { //function _msgSender() internal view virtual returns (address payable) { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mut...
_msgSender
function _msgSender() internal view virtual returns (address) { return msg.sender; }
//function _msgSender() internal view virtual returns (address payable) {
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 108, 211 ] }
3,162
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 606, 1230 ] }
3,163
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 2160, 2562 ] }
3,164
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 3318, 3496 ] }
3,165
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 3721, 3922 ] }
3,166
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 4292, 4523 ] }
3,167
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 4774, 5095 ] }
3,168
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
Solidity
Ownable
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */...
/** * @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.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 557, 641 ] }
3,169
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
Solidity
Ownable
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */...
/** * @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.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 1200, 1353 ] }
3,170
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
Solidity
Ownable
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */...
/** * @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.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 1503, 1752 ] }
3,171
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
Solidity
Ownable
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */...
/** * @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
lock
function lock(uint256 time) public virtual onlyOwner { _previousOwner = _owner; _owner = address(0); _lockTime = block.timestamp + time; emit OwnershipTransferred(_owner, address(0)); }
//Locks the contract for owner for the amount of time provided
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 1920, 2151 ] }
3,172
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
Solidity
Ownable
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */...
/** * @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
unlock
function unlock() public virtual { require(_previousOwner == msg.sender, "You don't have permission to unlock"); require(block.timestamp > _lockTime , "Contract is locked until 7 days"); emit OwnershipTransferred(_owner, _previousOwner); _owner = _previousOwner; }
//Unlocks the contract for owner when _lockTime is exceeds
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 2222, 2532 ] }
3,173
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
Solidity
BABYHAM
contract BABYHAM is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => b...
//to recieve ETH from uniswapV2Router when swaping
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 10248, 10282 ] }
3,174
BABYHAM
BABYHAM.sol
0xfc8d14474dac9b9d5edd29a437b43f53b3e8b223
Solidity
BABYHAM
contract BABYHAM is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => b...
_tokenTransfer
function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private { if(!canTrade){ require(sender == owner()); // only owner allowed to trade or add liquidity } if(botWallets[sender] || botWallets[recipient]){ require(botscantrade, "bots arent all...
//this method is responsible for taking all fee, if takeFee is true
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://a5dee20d41819052f29eae07268e10b4ed89b718b32ca1a3a4df9c6815f9cd41
{ "func_code_index": [ 18170, 19289 ] }
3,175
AaveMonitorV2
contracts/aaveV2/AaveHelperV2.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
AaveHelperV2
contract AaveHelperV2 is DSMath { using SafeERC20 for ERC20; IFeeRecipient public constant feeRecipient = IFeeRecipient(0x39C4a92Dc506300c3Ea4c67ca4CA611102ee6F2A); address public constant DISCOUNT_ADDR = 0x1b14E8D511c9A4395425314f849bD737BAF8208F; address public constant WETH_ADDRESS = 0xC02aaA39b22...
getGasCost
function getGasCost(address _oracleAddress, uint _amount, address _user, uint _gasCost, address _tokenAddr) internal returns (uint gasCost) { if (_gasCost == 0) return 0; // in case its ETH, we need to get price for WETH // everywhere else we still use ETH as thats the token we have in this moment add...
/// @notice Calculates the gas cost for transaction /// @param _oracleAddress address of oracle used /// @param _amount Amount that is converted /// @param _user Actuall user addr not DSProxy /// @param _gasCost Ether amount of gas we are spending for tx /// @param _tokenAddr token addr. of token we are getting for the...
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 1286, 2287 ] }
3,176
AaveMonitorV2
contracts/aaveV2/AaveHelperV2.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
AaveHelperV2
contract AaveHelperV2 is DSMath { using SafeERC20 for ERC20; IFeeRecipient public constant feeRecipient = IFeeRecipient(0x39C4a92Dc506300c3Ea4c67ca4CA611102ee6F2A); address public constant DISCOUNT_ADDR = 0x1b14E8D511c9A4395425314f849bD737BAF8208F; address public constant WETH_ADDRESS = 0xC02aaA39b22...
getUserAddress
function getUserAddress() internal view returns (address) { DSProxy proxy = DSProxy(payable(address(this))); return proxy.owner(); }
/// @notice Returns the owner of the DSProxy that called the contract
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 2364, 2521 ] }
3,177
AaveMonitorV2
contracts/aaveV2/AaveHelperV2.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
AaveHelperV2
contract AaveHelperV2 is DSMath { using SafeERC20 for ERC20; IFeeRecipient public constant feeRecipient = IFeeRecipient(0x39C4a92Dc506300c3Ea4c67ca4CA611102ee6F2A); address public constant DISCOUNT_ADDR = 0x1b14E8D511c9A4395425314f849bD737BAF8208F; address public constant WETH_ADDRESS = 0xC02aaA39b22...
approveToken
function approveToken(address _tokenAddr, address _caller) internal { if (_tokenAddr != ETH_ADDR) { ERC20(_tokenAddr).safeApprove(_caller, uint256(-1)); } }
/// @notice Approves token contract to pull underlying tokens from the DSProxy /// @param _tokenAddr Token we are trying to approve /// @param _caller Address which will gain the approval
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 2723, 2915 ] }
3,178
AaveMonitorV2
contracts/aaveV2/AaveHelperV2.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
AaveHelperV2
contract AaveHelperV2 is DSMath { using SafeERC20 for ERC20; IFeeRecipient public constant feeRecipient = IFeeRecipient(0x39C4a92Dc506300c3Ea4c67ca4CA611102ee6F2A); address public constant DISCOUNT_ADDR = 0x1b14E8D511c9A4395425314f849bD737BAF8208F; address public constant WETH_ADDRESS = 0xC02aaA39b22...
sendContractBalance
function sendContractBalance(address _token, address _user, uint _amount) internal { if (_amount == 0) return; if (_token == ETH_ADDR) { payable(_user).transfer(_amount); } else { ERC20(_token).safeTransfer(_user, _amount); } }
/// @notice Send specific amount from contract to specific user /// @param _token Token we are trying to send /// @param _user User that should receive funds /// @param _amount Amount that should be sent
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 3137, 3429 ] }
3,179
PYLONIncentivizer
contracts/CurveRewards.sol
0x6ffe25e45dc416790e43bf7f58eb57100bf27b46
Solidity
PYLONIncentivizer
contract PYLONIncentivizer is LPTokenWrapper, IRewardDistributionRecipient { IERC20 public pylon = IERC20(0xD7B7d3C0bdA57723Fb54ab95Fd8F9EA033AF37f2); uint256 public constant DURATION = 864000; uint256 public initreward = 6300 * 10**18; // 6,300 uint256 public starttime = 1599004800; // 2020-09-02...
stake
function stake(uint256 amount) public updateReward(msg.sender) checkhalve checkStart { require(amount > 0, "Cannot stake 0"); super.stake(amount); emit Staked(msg.sender, amount); }
// stake visibility is public as overriding LPTokenWrapper's stake() function
LineComment
v0.5.17+commit.d19bba13
None
bzzr://7725be373d065b3270d0e8328811731dca01309441f6756cadef14007949178b
{ "func_code_index": [ 2098, 2316 ] }
3,180
PYLONIncentivizer
contracts/CurveRewards.sol
0x6ffe25e45dc416790e43bf7f58eb57100bf27b46
Solidity
PYLONIncentivizer
contract PYLONIncentivizer is LPTokenWrapper, IRewardDistributionRecipient { IERC20 public pylon = IERC20(0xD7B7d3C0bdA57723Fb54ab95Fd8F9EA033AF37f2); uint256 public constant DURATION = 864000; uint256 public initreward = 6300 * 10**18; // 6,300 uint256 public starttime = 1599004800; // 2020-09-02...
governanceRecoverUnsupported
function governanceRecoverUnsupported(IERC20 _token, uint256 amount, address to) external { // only gov require(msg.sender == owner(), "!governance"); // cant take staked asset require(_token != uni_lp, "uni_lp"); // cant take reward asset require(_token != pylon, "pylon"); //...
// This function allows governance to take unsupported tokens out of the // contract, since this one exists longer than the other pools. // This is in an effort to make someone whole, should they seriously // mess up. There is no guarantee governance will vote to return these. // It also allows for removal of airdroppe...
LineComment
v0.5.17+commit.d19bba13
None
bzzr://7725be373d065b3270d0e8328811731dca01309441f6756cadef14007949178b
{ "func_code_index": [ 5120, 5542 ] }
3,181
AaveMonitorV2
contracts/reflexer/saver/RAISaverTaker.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverTaker
contract RAISaverTaker is RAISaverProxy, DydxFlashLoanBase, GasBurner { address public constant WETH_ADDR = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; struct SaverData { uint256 flAmount; bool isRepay; uint256 safeId; uint256 gasCost; address joinAddr; ManagerTy...
getMaxDebt
function getMaxDebt( address _managerAddr, uint256 _safeId, bytes32 _collType ) public override view returns (uint256) { (uint256 collateral, uint256 debt) = getSafeInfo(ISAFEManager(_managerAddr), _safeId, _collType); (, , uint256 safetyPrice, , , ) = ISAFEEngine(SAFE_ENGINE_ADDRES...
/// @notice Gets the maximum amount of debt available to generate /// @param _managerAddr Address of the CDP Manager /// @param _safeId Id of the CDP /// @param _collType Coll type of the CDP
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 2928, 3378 ] }
3,182
AaveMonitorV2
contracts/reflexer/saver/RAISaverTaker.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverTaker
contract RAISaverTaker is RAISaverProxy, DydxFlashLoanBase, GasBurner { address public constant WETH_ADDR = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; struct SaverData { uint256 flAmount; bool isRepay; uint256 safeId; uint256 gasCost; address joinAddr; ManagerTy...
getAvailableEthLiquidity
function getAvailableEthLiquidity() internal view returns (uint256 liquidity) { liquidity = ERC20(WETH_ADDR).balanceOf(SOLO_MARGIN_ADDRESS); }
/// @notice Fetches Eth Dydx liqudity
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 3422, 3580 ] }
3,183
AaveMonitorV2
contracts/reflexer/saver/RAISaverTaker.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverTaker
contract RAISaverTaker is RAISaverProxy, DydxFlashLoanBase, GasBurner { address public constant WETH_ADDR = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; struct SaverData { uint256 flAmount; bool isRepay; uint256 safeId; uint256 gasCost; address joinAddr; ManagerTy...
_flashLoan
function _flashLoan(address RAI_SAVER_FLASH_LOAN, ExchangeData memory _exchangeData, SaverData memory _saverData) internal { ISoloMargin solo = ISoloMargin(SOLO_MARGIN_ADDRESS); address managerAddr = getManagerAddr(_saverData.managerType); // Get marketId from token address uint256 marketId = _getMark...
/// @notice Starts the process to move users position 1 collateral and 1 borrow /// @dev User must send 2 wei with this transaction
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 3722, 5175 ] }
3,184
ADXLoyaltyPoolIncentiveController
ADXLoyaltyPoolIncentiveController.sol
0xb38d2e4600cf1d46dd6b1cdafd4584c2c2ea195b
Solidity
ADXLoyaltyPoolToken
contract ADXLoyaltyPoolToken { using SafeMath for uint; // ERC20 stuff // Constants string public constant name = "AdEx Loyalty"; uint8 public constant decimals = 18; string public symbol = "ADX-LOYALTY"; // Mutable variables uint public totalSupply; mapping(address => uint) balances; mapping(ad...
permit
function permit(address owner, address spender, uint amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external { require(deadline >= block.timestamp, 'DEADLINE_EXPIRED'); bytes32 digest = keccak256(abi.encodePacked( '\x19\x01', DOMAIN_SEPARATOR, keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, am...
// EIP 2612
LineComment
v0.6.12+commit.27d51765
GNU GPLv2
ipfs://67803eb19781617190b60c2e196c43c5253c348526740d7c593a1378de55507d
{ "func_code_index": [ 1909, 2511 ] }
3,185
ADXLoyaltyPoolIncentiveController
ADXLoyaltyPoolIncentiveController.sol
0xb38d2e4600cf1d46dd6b1cdafd4584c2c2ea195b
Solidity
ADXLoyaltyPoolToken
contract ADXLoyaltyPoolToken { using SafeMath for uint; // ERC20 stuff // Constants string public constant name = "AdEx Loyalty"; uint8 public constant decimals = 18; string public symbol = "ADX-LOYALTY"; // Mutable variables uint public totalSupply; mapping(address => uint) balances; mapping(ad...
innerMint
function innerMint(address owner, uint amount) internal { totalSupply = totalSupply.add(amount); balances[owner] = balances[owner].add(amount); // Because of https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#transfer-1 emit Transfer(address(0), owner, amount); }
// Inner
LineComment
v0.6.12+commit.27d51765
GNU GPLv2
ipfs://67803eb19781617190b60c2e196c43c5253c348526740d7c593a1378de55507d
{ "func_code_index": [ 2525, 2813 ] }
3,186
ADXLoyaltyPoolIncentiveController
ADXLoyaltyPoolIncentiveController.sol
0xb38d2e4600cf1d46dd6b1cdafd4584c2c2ea195b
Solidity
ADXLoyaltyPoolToken
contract ADXLoyaltyPoolToken { using SafeMath for uint; // ERC20 stuff // Constants string public constant name = "AdEx Loyalty"; uint8 public constant decimals = 18; string public symbol = "ADX-LOYALTY"; // Mutable variables uint public totalSupply; mapping(address => uint) balances; mapping(ad...
setGovernance
function setGovernance(address addr, bool hasGovt) external { require(governance[msg.sender], 'NOT_GOVERNANCE'); governance[addr] = hasGovt; emit LogSetGovernance(addr, hasGovt, block.timestamp); }
// Governance functions
LineComment
v0.6.12+commit.27d51765
GNU GPLv2
ipfs://67803eb19781617190b60c2e196c43c5253c348526740d7c593a1378de55507d
{ "func_code_index": [ 4039, 4249 ] }
3,187
ADXLoyaltyPoolIncentiveController
ADXLoyaltyPoolIncentiveController.sol
0xb38d2e4600cf1d46dd6b1cdafd4584c2c2ea195b
Solidity
ADXLoyaltyPoolToken
contract ADXLoyaltyPoolToken { using SafeMath for uint; // ERC20 stuff // Constants string public constant name = "AdEx Loyalty"; uint8 public constant decimals = 18; string public symbol = "ADX-LOYALTY"; // Mutable variables uint public totalSupply; mapping(address => uint) balances; mapping(ad...
setIncentive
function setIncentive(uint newIncentive) external { require(governance[msg.sender], 'NOT_GOVERNANCE'); incentivePerTokenPerAnnum = newIncentive; lastMintTime = block.timestamp; emit LogSetIncentive(newIncentive, block.timestamp); }
// This doesn't trigger a mint because otherwise we risk of being unable to setIncentive to 0 // if minting is impossible // It's the better tradeoff to make - and the issue of front-running mintIncnetive with setIncentive(0) can // be solved by timelocking the governance
LineComment
v0.6.12+commit.27d51765
GNU GPLv2
ipfs://67803eb19781617190b60c2e196c43c5253c348526740d7c593a1378de55507d
{ "func_code_index": [ 4531, 4778 ] }
3,188
ADXLoyaltyPoolIncentiveController
ADXLoyaltyPoolIncentiveController.sol
0xb38d2e4600cf1d46dd6b1cdafd4584c2c2ea195b
Solidity
ADXLoyaltyPoolToken
contract ADXLoyaltyPoolToken { using SafeMath for uint; // ERC20 stuff // Constants string public constant name = "AdEx Loyalty"; uint8 public constant decimals = 18; string public symbol = "ADX-LOYALTY"; // Mutable variables uint public totalSupply; mapping(address => uint) balances; mapping(ad...
toMint
function toMint() external view returns (uint) { if (block.timestamp <= lastMintTime) return 0; uint totalADX = ADXToken.balanceOf(address(this)); return (block.timestamp - lastMintTime) .mul(totalADX) .mul(incentivePerTokenPerAnnum) .div(365 days * 10e17); }
// Pool stuff // There are a few notable items in how minting works // 1) if ADX is sent to the LoyaltyPool in-between mints, it will calculate the incentive as if this amount // has been there the whole time since the last mint // 2) Compounding is happening when mint is called, so essentially when entities enter/leav...
LineComment
v0.6.12+commit.27d51765
GNU GPLv2
ipfs://67803eb19781617190b60c2e196c43c5253c348526740d7c593a1378de55507d
{ "func_code_index": [ 5424, 5708 ] }
3,189
ADXLoyaltyPoolIncentiveController
ADXLoyaltyPoolIncentiveController.sol
0xb38d2e4600cf1d46dd6b1cdafd4584c2c2ea195b
Solidity
ADXLoyaltyPoolToken
contract ADXLoyaltyPoolToken { using SafeMath for uint; // ERC20 stuff // Constants string public constant name = "AdEx Loyalty"; uint8 public constant decimals = 18; string public symbol = "ADX-LOYALTY"; // Mutable variables uint public totalSupply; mapping(address => uint) balances; mapping(ad...
emergencyLeave
function emergencyLeave(uint256 shares) external { leaveInner(shares); }
// Guarantees ADX can be taken out even if minting is failing
LineComment
v0.6.12+commit.27d51765
GNU GPLv2
ipfs://67803eb19781617190b60c2e196c43c5253c348526740d7c593a1378de55507d
{ "func_code_index": [ 7412, 7491 ] }
3,190
AaveMonitorV2
contracts/compound/comp/CompLeverage.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
CompLeverage
contract CompLeverage is DFSExchangeCore, CompBalance { address public constant C_COMP_ADDR = 0x70e36f6BF80a52b3B46b3aF8e106CC0ed743E8e4; address public constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public constant CETH_ADDRESS = 0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5; ...
claimAndSell
function claimAndSell( ExchangeData memory exchangeData, address[] memory _cTokensSupply, address[] memory _cTokensBorrow, address _cDepositAddr, bool _inMarket ) public payable { // Claim COMP token _claim(address(this), _cTokensSupply, _cTokensBorrow); uint compBalance = ERC20(COMP_AD...
/// @notice Should claim COMP and sell it to the specified token and deposit it back /// @param exchangeData Standard Exchange struct /// @param _cTokensSupply List of cTokens user is supplying /// @param _cTokensBorrow List of cTokens user is borrowing /// @param _cDepositAddr The cToken address of the asset you want ...
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 1112, 2758 ] }
3,191
AaveMonitorV2
contracts/reflexer/saver/RAISaverFlashLoan.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
RAISaverFlashLoan
contract RAISaverFlashLoan is RAISaverProxy, AdminAuth { address public constant WETH_ADDR = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; function callFunction( address, Account.Info memory, bytes memory _params ) public { ( bytes memory exDataBytes , ...
limitLoanAmount
function limitLoanAmount(address _managerAddr, uint _safeId, bytes32 _collType, uint _paybackAmount, address _owner) internal returns (uint256) { uint debt = getAllDebt(address(safeEngine), ISAFEManager(_managerAddr).safes(_safeId), ISAFEManager(_managerAddr).safes(_safeId), _collType); if (_paybackAmount > de...
/// @notice Handles that the amount is not bigger than cdp debt and not dust
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 3749, 4627 ] }
3,192
AaveMonitorV2
contracts/cream/CreamBasicProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
CreamBasicProxy
contract CreamBasicProxy is GasBurner { address public constant ETH_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public constant COMPTROLLER_ADDR = 0x3d5BC3c8d13dcB8bF317092d84783c2697AE9258; using SafeERC20 for ERC20; /// @notice User deposits tokens to the cream protocol /// @dev ...
/// @title Basic cream interactions through the DSProxy
NatSpecSingleLine
deposit
function deposit(address _tokenAddr, address _cTokenAddr, uint _amount, bool _inMarket) public burnGas(5) payable { if (_tokenAddr != ETH_ADDR) { ERC20(_tokenAddr).safeTransferFrom(msg.sender, address(this), _amount); } approveToken(_tokenAddr, _cTokenAddr); if (!_inMarket) { enterMark...
/// @notice User deposits tokens to the cream protocol /// @dev User needs to approve the DSProxy to pull the _tokenAddr tokens /// @param _tokenAddr The address of the token to be deposited /// @param _cTokenAddr CTokens to be deposited /// @param _amount Amount of tokens to be deposited /// @param _inMarket True if t...
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 639, 1241 ] }
3,193
AaveMonitorV2
contracts/cream/CreamBasicProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
CreamBasicProxy
contract CreamBasicProxy is GasBurner { address public constant ETH_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public constant COMPTROLLER_ADDR = 0x3d5BC3c8d13dcB8bF317092d84783c2697AE9258; using SafeERC20 for ERC20; /// @notice User deposits tokens to the cream protocol /// @dev ...
/// @title Basic cream interactions through the DSProxy
NatSpecSingleLine
withdraw
function withdraw(address _tokenAddr, address _cTokenAddr, uint _amount, bool _isCAmount) public burnGas(5) { if (_isCAmount) { require(CTokenInterface(_cTokenAddr).redeem(_amount) == 0); } else { require(CTokenInterface(_cTokenAddr).redeemUnderlying(_amount) == 0); } // withdraw funds...
/// @notice User withdraws tokens to the cream protocol /// @param _tokenAddr The address of the token to be withdrawn /// @param _cTokenAddr CTokens to be withdrawn /// @param _amount Amount of tokens to be withdrawn /// @param _isCAmount If true _amount is cTokens if falls _amount is underlying tokens
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 1568, 2158 ] }
3,194
AaveMonitorV2
contracts/cream/CreamBasicProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
CreamBasicProxy
contract CreamBasicProxy is GasBurner { address public constant ETH_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public constant COMPTROLLER_ADDR = 0x3d5BC3c8d13dcB8bF317092d84783c2697AE9258; using SafeERC20 for ERC20; /// @notice User deposits tokens to the cream protocol /// @dev ...
/// @title Basic cream interactions through the DSProxy
NatSpecSingleLine
borrow
function borrow(address _tokenAddr, address _cTokenAddr, uint _amount, bool _inMarket) public burnGas(8) { if (!_inMarket) { enterMarket(_cTokenAddr); } require(CTokenInterface(_cTokenAddr).borrow(_amount) == 0); // withdraw funds to msg.sender if (_tokenAddr != ETH_ADDR) { ERC20(_...
/// @notice User borrows tokens to the cream protocol /// @param _tokenAddr The address of the token to be borrowed /// @param _cTokenAddr CTokens to be borrowed /// @param _amount Amount of tokens to be borrowed /// @param _inMarket True if the token is already in market for that address
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 2470, 2991 ] }
3,195
AaveMonitorV2
contracts/cream/CreamBasicProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
CreamBasicProxy
contract CreamBasicProxy is GasBurner { address public constant ETH_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public constant COMPTROLLER_ADDR = 0x3d5BC3c8d13dcB8bF317092d84783c2697AE9258; using SafeERC20 for ERC20; /// @notice User deposits tokens to the cream protocol /// @dev ...
/// @title Basic cream interactions through the DSProxy
NatSpecSingleLine
payback
function payback(address _tokenAddr, address _cTokenAddr, uint _amount, bool _wholeDebt) public burnGas(5) payable { approveToken(_tokenAddr, _cTokenAddr); if (_wholeDebt) { _amount = CTokenInterface(_cTokenAddr).borrowBalanceCurrent(address(this)); } if (_tokenAddr != ETH_ADDR) { ERC2...
/// @dev User needs to approve the DSProxy to pull the _tokenAddr tokens /// @notice User paybacks tokens to the cream protocol /// @param _tokenAddr The address of the token to be paybacked /// @param _cTokenAddr CTokens to be paybacked /// @param _amount Amount of tokens to be payedback /// @param _wholeDebt If true ...
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 3393, 4076 ] }
3,196
AaveMonitorV2
contracts/cream/CreamBasicProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
CreamBasicProxy
contract CreamBasicProxy is GasBurner { address public constant ETH_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public constant COMPTROLLER_ADDR = 0x3d5BC3c8d13dcB8bF317092d84783c2697AE9258; using SafeERC20 for ERC20; /// @notice User deposits tokens to the cream protocol /// @dev ...
/// @title Basic cream interactions through the DSProxy
NatSpecSingleLine
withdrawTokens
function withdrawTokens(address _tokenAddr) public { if (_tokenAddr != ETH_ADDR) { ERC20(_tokenAddr).safeTransfer(msg.sender, ERC20(_tokenAddr).balanceOf(address(this))); } else { msg.sender.transfer(address(this).balance); } }
/// @notice Helper method to withdraw tokens from the DSProxy /// @param _tokenAddr Address of the token to be withdrawn
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 4207, 4490 ] }
3,197
AaveMonitorV2
contracts/cream/CreamBasicProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
CreamBasicProxy
contract CreamBasicProxy is GasBurner { address public constant ETH_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public constant COMPTROLLER_ADDR = 0x3d5BC3c8d13dcB8bF317092d84783c2697AE9258; using SafeERC20 for ERC20; /// @notice User deposits tokens to the cream protocol /// @dev ...
/// @title Basic cream interactions through the DSProxy
NatSpecSingleLine
enterMarket
function enterMarket(address _cTokenAddr) public { address[] memory markets = new address[](1); markets[0] = _cTokenAddr; ComptrollerInterface(COMPTROLLER_ADDR).enterMarkets(markets); }
/// @notice Enters the cream market so it can be deposited/borrowed /// @param _cTokenAddr CToken address of the token
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 4619, 4837 ] }
3,198
AaveMonitorV2
contracts/cream/CreamBasicProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
CreamBasicProxy
contract CreamBasicProxy is GasBurner { address public constant ETH_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public constant COMPTROLLER_ADDR = 0x3d5BC3c8d13dcB8bF317092d84783c2697AE9258; using SafeERC20 for ERC20; /// @notice User deposits tokens to the cream protocol /// @dev ...
/// @title Basic cream interactions through the DSProxy
NatSpecSingleLine
exitMarket
function exitMarket(address _cTokenAddr) public { ComptrollerInterface(COMPTROLLER_ADDR).exitMarket(_cTokenAddr); }
/// @notice Exits the cream market so it can't be deposited/borrowed /// @param _cTokenAddr CToken address of the token
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 4967, 5098 ] }
3,199
AaveMonitorV2
contracts/cream/CreamBasicProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
CreamBasicProxy
contract CreamBasicProxy is GasBurner { address public constant ETH_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public constant COMPTROLLER_ADDR = 0x3d5BC3c8d13dcB8bF317092d84783c2697AE9258; using SafeERC20 for ERC20; /// @notice User deposits tokens to the cream protocol /// @dev ...
/// @title Basic cream interactions through the DSProxy
NatSpecSingleLine
approveToken
function approveToken(address _tokenAddr, address _cTokenAddr) internal { if (_tokenAddr != ETH_ADDR) { ERC20(_tokenAddr).safeApprove(_cTokenAddr, uint(-1)); } }
/// @notice Approves CToken contract to pull underlying tokens from the DSProxy /// @param _tokenAddr Token we are trying to approve /// @param _cTokenAddr Address which will gain the approval
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 5305, 5502 ] }
3,200
AuctionityDepositEth
AuctionityDepositEth.sol
0xf70b35ebf5e6ef3d31b3f753c9763a1d225bd00d
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://githu...
/** * @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) { // Gas optimization: this is cheaper than asserting '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; } c = a...
/** * @dev Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://e28de8a167f93e67d9a086483d4ae23ee8f634de883d586e7db48b15e4a1cb33
{ "func_code_index": [ 89, 476 ] }
3,201
AuctionityDepositEth
AuctionityDepositEth.sol
0xf70b35ebf5e6ef3d31b3f753c9763a1d225bd00d
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://githu...
/** * @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.24+commit.e67f0147
bzzr://e28de8a167f93e67d9a086483d4ae23ee8f634de883d586e7db48b15e4a1cb33
{ "func_code_index": [ 560, 840 ] }
3,202
AuctionityDepositEth
AuctionityDepositEth.sol
0xf70b35ebf5e6ef3d31b3f753c9763a1d225bd00d
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://githu...
/** * @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.24+commit.e67f0147
bzzr://e28de8a167f93e67d9a086483d4ae23ee8f634de883d586e7db48b15e4a1cb33
{ "func_code_index": [ 954, 1070 ] }
3,203
AuctionityDepositEth
AuctionityDepositEth.sol
0xf70b35ebf5e6ef3d31b3f753c9763a1d225bd00d
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://githu...
/** * @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.24+commit.e67f0147
bzzr://e28de8a167f93e67d9a086483d4ae23ee8f634de883d586e7db48b15e4a1cb33
{ "func_code_index": [ 1134, 1264 ] }
3,204
AuctionityDepositEth
AuctionityDepositEth.sol
0xf70b35ebf5e6ef3d31b3f753c9763a1d225bd00d
Solidity
RLPReader
library RLPReader { uint8 constant STRING_SHORT_START = 0x80; uint8 constant STRING_LONG_START = 0xb8; uint8 constant LIST_SHORT_START = 0xc0; uint8 constant LIST_LONG_START = 0xf8; uint8 constant WORD_SIZE = 32; struct RLPItem { uint len; uint memPtr; } ...
toRlpItem
function toRlpItem(bytes memory item) internal pure returns (RLPItem memory) { if (item.length == 0) return RLPItem(0, 0); uint memPtr; assembly { memPtr := add(item, 0x20) } return RLPItem(item.length, memPtr); }
/* * @param item RLP encoded bytes */
Comment
v0.4.24+commit.e67f0147
bzzr://e28de8a167f93e67d9a086483d4ae23ee8f634de883d586e7db48b15e4a1cb33
{ "func_code_index": [ 374, 672 ] }
3,205
AuctionityDepositEth
AuctionityDepositEth.sol
0xf70b35ebf5e6ef3d31b3f753c9763a1d225bd00d
Solidity
RLPReader
library RLPReader { uint8 constant STRING_SHORT_START = 0x80; uint8 constant STRING_LONG_START = 0xb8; uint8 constant LIST_SHORT_START = 0xc0; uint8 constant LIST_LONG_START = 0xf8; uint8 constant WORD_SIZE = 32; struct RLPItem { uint len; uint memPtr; } ...
toList
function toList(RLPItem memory item) internal pure returns (RLPItem[] memory result) { require(isList(item)); uint items = numItems(item); result = new RLPItem[](items); uint memPtr = item.memPtr + _payloadOffset(item.memPtr); uint dataLen; for (uint i = 0; i < items; i++) { d...
/* * @param item RLP encoded list in bytes */
Comment
v0.4.24+commit.e67f0147
bzzr://e28de8a167f93e67d9a086483d4ae23ee8f634de883d586e7db48b15e4a1cb33
{ "func_code_index": [ 736, 1227 ] }
3,206