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
OracleFactory
contracts/commons/Ownable.sol
0x1101c52fc25dc6d2691cec4b06569cef3c83933c
Solidity
Ownable
contract Ownable { address internal _owner; event OwnershipTransferred(address indexed _from, address indexed _to); modifier onlyOwner() { require(msg.sender == _owner, "The owner should be the sender"); _; } constructor() public { _owner = msg.sender; ...
transferOwnership
function transferOwnership(address _newOwner) external onlyOwner { require(_newOwner != address(0), "0x0 Is not a valid owner"); emit OwnershipTransferred(_owner, _newOwner); _owner = _newOwner; }
/** @dev Transfers the ownership of the contract. @param _newOwner Address of the new owner */
NatSpecMultiLine
v0.5.12+commit.7709ece9
GNU GPLv3
bzzr://eba975dd187864082d14c6245f52ce14bd90dde2a9adcb6e6a4fb661b3119d6c
{ "func_code_index": [ 595, 828 ] }
16,000
OracleFactory
contracts/interfaces/RateOracle.sol
0x1101c52fc25dc6d2691cec4b06569cef3c83933c
Solidity
RateOracle
contract RateOracle { uint256 public constant VERSION = 5; bytes4 internal constant RATE_ORACLE_INTERFACE = 0xa265d8e0; /** 3 or 4 letters symbol of the currency, Ej: ETH */ function symbol() external view returns (string memory); /** Descriptive name of the currency,...
/** @dev Defines the interface of a standard Diaspore RCN Oracle, The contract should also implement it's ERC165 interface: 0xa265d8e0 @notice Each oracle can only support one currency @author Agustin Aguilar */
NatSpecMultiLine
symbol
function symbol() external view returns (string memory);
/** 3 or 4 letters symbol of the currency, Ej: ETH */
NatSpecMultiLine
v0.5.12+commit.7709ece9
GNU GPLv3
bzzr://eba975dd187864082d14c6245f52ce14bd90dde2a9adcb6e6a4fb661b3119d6c
{ "func_code_index": [ 206, 267 ] }
16,001
OracleFactory
contracts/interfaces/RateOracle.sol
0x1101c52fc25dc6d2691cec4b06569cef3c83933c
Solidity
RateOracle
contract RateOracle { uint256 public constant VERSION = 5; bytes4 internal constant RATE_ORACLE_INTERFACE = 0xa265d8e0; /** 3 or 4 letters symbol of the currency, Ej: ETH */ function symbol() external view returns (string memory); /** Descriptive name of the currency,...
/** @dev Defines the interface of a standard Diaspore RCN Oracle, The contract should also implement it's ERC165 interface: 0xa265d8e0 @notice Each oracle can only support one currency @author Agustin Aguilar */
NatSpecMultiLine
name
function name() external view returns (string memory);
/** Descriptive name of the currency, Ej: Ethereum */
NatSpecMultiLine
v0.5.12+commit.7709ece9
GNU GPLv3
bzzr://eba975dd187864082d14c6245f52ce14bd90dde2a9adcb6e6a4fb661b3119d6c
{ "func_code_index": [ 343, 402 ] }
16,002
OracleFactory
contracts/interfaces/RateOracle.sol
0x1101c52fc25dc6d2691cec4b06569cef3c83933c
Solidity
RateOracle
contract RateOracle { uint256 public constant VERSION = 5; bytes4 internal constant RATE_ORACLE_INTERFACE = 0xa265d8e0; /** 3 or 4 letters symbol of the currency, Ej: ETH */ function symbol() external view returns (string memory); /** Descriptive name of the currency,...
/** @dev Defines the interface of a standard Diaspore RCN Oracle, The contract should also implement it's ERC165 interface: 0xa265d8e0 @notice Each oracle can only support one currency @author Agustin Aguilar */
NatSpecMultiLine
decimals
function decimals() external view returns (uint256);
/** The number of decimals of the currency represented by this Oracle, it should be the most common number of decimal places */
NatSpecMultiLine
v0.5.12+commit.7709ece9
GNU GPLv3
bzzr://eba975dd187864082d14c6245f52ce14bd90dde2a9adcb6e6a4fb661b3119d6c
{ "func_code_index": [ 565, 622 ] }
16,003
OracleFactory
contracts/interfaces/RateOracle.sol
0x1101c52fc25dc6d2691cec4b06569cef3c83933c
Solidity
RateOracle
contract RateOracle { uint256 public constant VERSION = 5; bytes4 internal constant RATE_ORACLE_INTERFACE = 0xa265d8e0; /** 3 or 4 letters symbol of the currency, Ej: ETH */ function symbol() external view returns (string memory); /** Descriptive name of the currency,...
/** @dev Defines the interface of a standard Diaspore RCN Oracle, The contract should also implement it's ERC165 interface: 0xa265d8e0 @notice Each oracle can only support one currency @author Agustin Aguilar */
NatSpecMultiLine
token
function token() external view returns (address);
/** The base token on which the sample is returned should be the RCN Token address. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
GNU GPLv3
bzzr://eba975dd187864082d14c6245f52ce14bd90dde2a9adcb6e6a4fb661b3119d6c
{ "func_code_index": [ 744, 798 ] }
16,004
OracleFactory
contracts/interfaces/RateOracle.sol
0x1101c52fc25dc6d2691cec4b06569cef3c83933c
Solidity
RateOracle
contract RateOracle { uint256 public constant VERSION = 5; bytes4 internal constant RATE_ORACLE_INTERFACE = 0xa265d8e0; /** 3 or 4 letters symbol of the currency, Ej: ETH */ function symbol() external view returns (string memory); /** Descriptive name of the currency,...
/** @dev Defines the interface of a standard Diaspore RCN Oracle, The contract should also implement it's ERC165 interface: 0xa265d8e0 @notice Each oracle can only support one currency @author Agustin Aguilar */
NatSpecMultiLine
currency
function currency() external view returns (bytes32);
/** The currency symbol encoded on a UTF-8 Hex */
NatSpecMultiLine
v0.5.12+commit.7709ece9
GNU GPLv3
bzzr://eba975dd187864082d14c6245f52ce14bd90dde2a9adcb6e6a4fb661b3119d6c
{ "func_code_index": [ 870, 927 ] }
16,005
OracleFactory
contracts/interfaces/RateOracle.sol
0x1101c52fc25dc6d2691cec4b06569cef3c83933c
Solidity
RateOracle
contract RateOracle { uint256 public constant VERSION = 5; bytes4 internal constant RATE_ORACLE_INTERFACE = 0xa265d8e0; /** 3 or 4 letters symbol of the currency, Ej: ETH */ function symbol() external view returns (string memory); /** Descriptive name of the currency,...
/** @dev Defines the interface of a standard Diaspore RCN Oracle, The contract should also implement it's ERC165 interface: 0xa265d8e0 @notice Each oracle can only support one currency @author Agustin Aguilar */
NatSpecMultiLine
maintainer
function maintainer() external view returns (string memory);
/** The name of the Individual or Company in charge of this Oracle */
NatSpecMultiLine
v0.5.12+commit.7709ece9
GNU GPLv3
bzzr://eba975dd187864082d14c6245f52ce14bd90dde2a9adcb6e6a4fb661b3119d6c
{ "func_code_index": [ 1019, 1084 ] }
16,006
OracleFactory
contracts/interfaces/RateOracle.sol
0x1101c52fc25dc6d2691cec4b06569cef3c83933c
Solidity
RateOracle
contract RateOracle { uint256 public constant VERSION = 5; bytes4 internal constant RATE_ORACLE_INTERFACE = 0xa265d8e0; /** 3 or 4 letters symbol of the currency, Ej: ETH */ function symbol() external view returns (string memory); /** Descriptive name of the currency,...
/** @dev Defines the interface of a standard Diaspore RCN Oracle, The contract should also implement it's ERC165 interface: 0xa265d8e0 @notice Each oracle can only support one currency @author Agustin Aguilar */
NatSpecMultiLine
url
function url() external view returns (string memory);
/** Returns the url where the oracle exposes a valid "oracleData" if needed */
NatSpecMultiLine
v0.5.12+commit.7709ece9
GNU GPLv3
bzzr://eba975dd187864082d14c6245f52ce14bd90dde2a9adcb6e6a4fb661b3119d6c
{ "func_code_index": [ 1185, 1243 ] }
16,007
OracleFactory
contracts/interfaces/RateOracle.sol
0x1101c52fc25dc6d2691cec4b06569cef3c83933c
Solidity
RateOracle
contract RateOracle { uint256 public constant VERSION = 5; bytes4 internal constant RATE_ORACLE_INTERFACE = 0xa265d8e0; /** 3 or 4 letters symbol of the currency, Ej: ETH */ function symbol() external view returns (string memory); /** Descriptive name of the currency,...
/** @dev Defines the interface of a standard Diaspore RCN Oracle, The contract should also implement it's ERC165 interface: 0xa265d8e0 @notice Each oracle can only support one currency @author Agustin Aguilar */
NatSpecMultiLine
readSample
function readSample(bytes calldata _data) external view returns (uint256 _tokens, uint256 _equivalent);
/** Returns a sample on how many token() are equals to how many currency() */
NatSpecMultiLine
v0.5.12+commit.7709ece9
GNU GPLv3
bzzr://eba975dd187864082d14c6245f52ce14bd90dde2a9adcb6e6a4fb661b3119d6c
{ "func_code_index": [ 1343, 1451 ] }
16,008
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
ray
function ray() internal pure returns (uint256) { return RAY; }
/** * @return One ray, 1e27 **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 475, 545 ] }
16,009
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
wad
function wad() internal pure returns (uint256) { return WAD; }
/** * @return One wad, 1e18 **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 588, 658 ] }
16,010
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
way
function way() internal pure returns (uint256) { return WAD; }
/** * @return One way, 1e9 **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 696, 766 ] }
16,011
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
halfRay
function halfRay() internal pure returns (uint256) { return halfRAY; }
/** * @return Half ray, 1e27/2 **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 811, 889 ] }
16,012
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
halfWad
function halfWad() internal pure returns (uint256) { return halfWAD; }
/** * @return Half wad, 1e18/2 **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 934, 1012 ] }
16,013
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
halfWay
function halfWay() internal pure returns (uint256) { return halfWAY; }
/** * @return Half way, 1e9/2 **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 1052, 1130 ] }
16,014
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
wayMul
function wayMul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0 || b == 0) { return 0; } require(a <= (type(uint256).max - halfWAY) / b, Errors.MATH_MULTIPLICATION_OVERFLOW); return (a * b + halfWAY) / WAY; }
/** * @dev Multiplies two way, rounding half up to the nearest way * @param a Way * @param b Way * @return The result of a*b, in way **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 1276, 1531 ] }
16,015
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
wayDiv
function wayDiv(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, Errors.MATH_DIVISION_BY_ZERO); uint256 halfB = b / 2; require(a <= (type(uint256).max - halfB) / WAY, Errors.MATH_MULTIPLICATION_OVERFLOW); return (a * WAY + halfB) / b; }
/** * @dev Divides two way, rounding half up to the nearest way * @param a Way * @param b Way * @return The result of a/b, in way **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 1684, 1965 ] }
16,016
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
wadMul
function wadMul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0 || b == 0) { return 0; } require(a <= (type(uint256).max - halfWAD) / b, Errors.MATH_MULTIPLICATION_OVERFLOW); return (a * b + halfWAD) / WAD; }
/** * @dev Multiplies two wad, rounding half up to the nearest wad * @param a Wad * @param b Wad * @return The result of a*b, in wad **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 2121, 2376 ] }
16,017
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
wadDiv
function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, Errors.MATH_DIVISION_BY_ZERO); uint256 halfB = b / 2; require(a <= (type(uint256).max - halfB) / WAD, Errors.MATH_MULTIPLICATION_OVERFLOW); return (a * WAD + halfB) / b; }
/** * @dev Divides two wad, rounding half up to the nearest wad * @param a Wad * @param b Wad * @return The result of a/b, in wad **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 2529, 2810 ] }
16,018
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
rayMul
function rayMul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0 || b == 0) { return 0; } require(a <= (type(uint256).max - halfRAY) / b, Errors.MATH_MULTIPLICATION_OVERFLOW); return (a * b + halfRAY) / RAY; }
/** * @dev Multiplies two ray, rounding half up to the nearest ray * @param a Ray * @param b Ray * @return The result of a*b, in ray **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 2966, 3221 ] }
16,019
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
rayDiv
function rayDiv(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, Errors.MATH_DIVISION_BY_ZERO); uint256 halfB = b / 2; require(a <= (type(uint256).max - halfB) / RAY, Errors.MATH_MULTIPLICATION_OVERFLOW); return (a * RAY + halfB) / b; }
/** * @dev Divides two ray, rounding half up to the nearest ray * @param a Ray * @param b Ray * @return The result of a/b, in ray **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 3374, 3655 ] }
16,020
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
rayToWad
function rayToWad(uint256 a) internal pure returns (uint256) { uint256 halfRatio = WAD_RAY_RATIO / 2; uint256 result = halfRatio + a; require(result >= halfRatio, Errors.MATH_ADDITION_OVERFLOW); return result / WAD_RAY_RATIO; }
/** * @dev Casts ray down to wad * @param a Ray * @return a casted to wad, rounded half up to the nearest wad **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 3785, 4033 ] }
16,021
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
wadToRay
function wadToRay(uint256 a) internal pure returns (uint256) { uint256 result = a * WAD_RAY_RATIO; require(result / WAD_RAY_RATIO == a, Errors.MATH_MULTIPLICATION_OVERFLOW); return result; }
/** * @dev Converts wad up to ray * @param a Wad * @return a converted in ray **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 4131, 4337 ] }
16,022
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
wayToRay
function wayToRay(uint256 a) internal pure returns (uint256) { uint256 result = a * WAY_RAY_RATIO; require(result / WAY_RAY_RATIO == a, Errors.MATH_MULTIPLICATION_OVERFLOW); return result; }
/** * @dev Converts way up to ray * @param a Way * @return a converted in ray **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 4685, 4891 ] }
16,023
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
wadToWay
function wadToWay(uint256 a) internal pure returns (uint256) { uint256 halfRatio = WAY_WAD_RATIO / 2; uint256 result = halfRatio + a; require(result >= halfRatio, Errors.MATH_ADDITION_OVERFLOW); return result / WAY_WAD_RATIO; }
/** * @dev Casts wad down to way * @param a Wad * @return a casted to way, rounded half up to the nearest way **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 5021, 5269 ] }
16,024
AAmplToken
contracts/protocol/libraries/math/WadRayMath.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
WadRayMath
library WadRayMath { uint256 internal constant WAY = 1e9; uint256 internal constant halfWAY = WAY / 2; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_...
/** * @title WadRayMath library * @author Aave * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) **/
NatSpecMultiLine
wayToWad
function wayToWad(uint256 a) internal pure returns (uint256) { uint256 result = a * WAY_WAD_RATIO; require(result / WAY_WAD_RATIO == a, Errors.MATH_MULTIPLICATION_OVERFLOW); return result; }
/** * @dev Converts way up to wad * @param a Way * @return a converted in wad **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 5363, 5569 ] }
16,025
BasketBalancer
contracts/governance/BasketBalancer.sol
0x5af2c9a84b6dc6b44a4d318df75a7b71d65f3886
Solidity
BasketBalancer
contract BasketBalancer { using SafeMath for uint256; uint256 public fullAllocation; uint128 public lastEpochUpdate; uint256 public lastEpochEnd; uint256 public maxDelta; address[] private allTokens; mapping(address => uint256) public continuousVote; mapping(address => uint256) privat...
updateBasketBalance
function updateBasketBalance() public onlyDAO { uint128 _epochId = getCurrentEpoch(); require(lastEpochUpdate < _epochId, "Epoch is not over"); for (uint256 i = 0; i < allTokens.length; i++) { uint256 _currentValue = continuousVote[allTokens[i]]; // new vote outcome uint256 _previousValue =...
// Counts votes and sets the outcome allocation for each pool, // can be called by anyone through DAO after an epoch ends. // The new allocation value is the average of the vote outcome and the current value
LineComment
v0.7.6+commit.7338295f
{ "func_code_index": [ 2235, 3163 ] }
16,026
BasketBalancer
contracts/governance/BasketBalancer.sol
0x5af2c9a84b6dc6b44a4d318df75a7b71d65f3886
Solidity
BasketBalancer
contract BasketBalancer { using SafeMath for uint256; uint256 public fullAllocation; uint128 public lastEpochUpdate; uint256 public lastEpochEnd; uint256 public maxDelta; address[] private allTokens; mapping(address => uint256) public continuousVote; mapping(address => uint256) privat...
updateAllocationVote
function updateAllocationVote( address[] calldata tokens, uint256[] calldata allocations ) external { uint128 _epoch = getCurrentEpoch(); // Checks require( tokens.length == allTokens.length, "Need to vote for all tokens" ); require( tokens.length == allocations.leng...
// Allows users to update their vote by giving a desired allocation for each pool // tokens and allocations need to share the index, pool at index 1 will get allocation at index 1
LineComment
v0.7.6+commit.7338295f
{ "func_code_index": [ 3353, 5777 ] }
16,027
BasketBalancer
contracts/governance/BasketBalancer.sol
0x5af2c9a84b6dc6b44a4d318df75a7b71d65f3886
Solidity
BasketBalancer
contract BasketBalancer { using SafeMath for uint256; uint256 public fullAllocation; uint128 public lastEpochUpdate; uint256 public lastEpochEnd; uint256 public maxDelta; address[] private allTokens; mapping(address => uint256) public continuousVote; mapping(address => uint256) privat...
addToken
function addToken(address token, uint256 allocation) external onlyDAO returns (uint256) { // add token and store allocation allTokens.push(token); tokenAllocationBefore[token] = allocation; tokenAllocation[token] = allocation; continuousVote[token] = allocation; //update total alloc...
// adds a token to the baskte balancer // this mirrors the tokens in the pool both in allocation and order added // every time a token is added to the pool it needs to be added here as well
LineComment
v0.7.6+commit.7338295f
{ "func_code_index": [ 5981, 6490 ] }
16,028
BasketBalancer
contracts/governance/BasketBalancer.sol
0x5af2c9a84b6dc6b44a4d318df75a7b71d65f3886
Solidity
BasketBalancer
contract BasketBalancer { using SafeMath for uint256; uint256 public fullAllocation; uint128 public lastEpochUpdate; uint256 public lastEpochEnd; uint256 public maxDelta; address[] private allTokens; mapping(address => uint256) public continuousVote; mapping(address => uint256) privat...
removeToken
function removeToken(address token) external onlyDAO returns (uint256) { require(tokenAllocation[token] != 0, "Token is not part of Basket"); fullAllocation = fullAllocation.sub(continuousVote[token]); //remove token from array, moving all others 1 down if necessary uint256 index; for (uint256 i =...
// removes a token from the baskte balancer // every time a token is removed to the pool it needs to be removed here as well
LineComment
v0.7.6+commit.7338295f
{ "func_code_index": [ 6625, 7479 ] }
16,029
BasketBalancer
contracts/governance/BasketBalancer.sol
0x5af2c9a84b6dc6b44a4d318df75a7b71d65f3886
Solidity
BasketBalancer
contract BasketBalancer { using SafeMath for uint256; uint256 public fullAllocation; uint128 public lastEpochUpdate; uint256 public lastEpochEnd; uint256 public maxDelta; address[] private allTokens; mapping(address => uint256) public continuousVote; mapping(address => uint256) privat...
setRouter
function setRouter(address _poolRouter) public onlyDAO { poolRouter = _poolRouter; }
/* * SETTERS */
Comment
v0.7.6+commit.7338295f
{ "func_code_index": [ 7514, 7614 ] }
16,030
BasketBalancer
contracts/governance/BasketBalancer.sol
0x5af2c9a84b6dc6b44a4d318df75a7b71d65f3886
Solidity
BasketBalancer
contract BasketBalancer { using SafeMath for uint256; uint256 public fullAllocation; uint128 public lastEpochUpdate; uint256 public lastEpochEnd; uint256 public maxDelta; address[] private allTokens; mapping(address => uint256) public continuousVote; mapping(address => uint256) privat...
getTargetAllocation
function getTargetAllocation(address pool) public view returns (uint256) { return tokenAllocation[pool]; }
// gets the current target allocation
LineComment
v0.7.6+commit.7338295f
{ "func_code_index": [ 7885, 8007 ] }
16,031
BasketBalancer
contracts/governance/BasketBalancer.sol
0x5af2c9a84b6dc6b44a4d318df75a7b71d65f3886
Solidity
BasketBalancer
contract BasketBalancer { using SafeMath for uint256; uint256 public fullAllocation; uint128 public lastEpochUpdate; uint256 public lastEpochEnd; uint256 public maxDelta; address[] private allTokens; mapping(address => uint256) public continuousVote; mapping(address => uint256) privat...
getCurrentEpoch
function getCurrentEpoch() public view returns (uint128) { return reign.getCurrentEpoch(); }
//Returns the id of the current epoch from reignDiamond
LineComment
v0.7.6+commit.7338295f
{ "func_code_index": [ 8069, 8177 ] }
16,032
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
Context
contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (addres...
_msgSender
function _msgSender() internal view returns (address payable) { return msg.sender; }
// solhint-disable-previous-line no-empty-blocks
LineComment
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 265, 368 ] }
16,033
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
TRC20
interface TRC20 { /** * @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. Does not include * the optional functions; to access them see {ERC20Detailed}. */
NatSpecMultiLine
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 93, 153 ] }
16,034
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
TRC20
interface TRC20 { /** * @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. Does not include * the optional functions; to access them see {ERC20Detailed}. */
NatSpecMultiLine
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 236, 309 ] }
16,035
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
TRC20
interface TRC20 { /** * @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. Does not include * the optional functions; to access them see {ERC20Detailed}. */
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.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 533, 615 ] }
16,036
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
TRC20
interface TRC20 { /** * @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. Does not include * the optional functions; to access them see {ERC20Detailed}. */
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.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 894, 982 ] }
16,037
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
TRC20
interface TRC20 { /** * @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. Does not include * the optional functions; to access them see {ERC20Detailed}. */
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.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 1646, 1725 ] }
16,038
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
TRC20
interface TRC20 { /** * @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. Does not include * the optional functions; to access them see {ERC20Detailed}. */
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.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 2038, 2140 ] }
16,039
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming 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.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 251, 437 ] }
16,040
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 707, 848 ] }
16,041
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming 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. * * _Available since v2.4.0._ */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 1180, 1377 ] }
16,042
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 1623, 2099 ] }
16,043
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to reve...
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 2562, 2699 ] }
16,044
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; ...
/** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an in...
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 3224, 3574 ] }
16,045
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consumi...
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 4026, 4161 ] }
16,046
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcod...
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 4675, 4846 ] }
16,047
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
totalSupply
function totalSupply() public view returns (uint256) { return _totalSupply; }
/** * @dev See {TRC20-totalSupply}. */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 477, 573 ] }
16,048
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
balanceOf
function balanceOf(address account) public view returns (uint256) { return _balances[account]; }
/** * @dev See {TRC20-balanceOf}. */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 630, 745 ] }
16,049
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
/** * @dev See {TRC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 952, 1115 ] }
16,050
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {TRC20-allowance}. */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 1172, 1311 ] }
16,051
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {TRC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 1452, 1609 ] }
16,052
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; }
/** * @dev See {TRC20-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 `amoun...
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 2075, 2384 ] }
16,053
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; }
/** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {TRC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` ca...
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 2787, 3002 ] }
16,054
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; }
/** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {TRC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` ca...
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 3499, 3765 ] }
16,055
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
_transfer
function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exc...
/** * @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.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 4250, 4726 ] }
16,056
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
_mint
function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(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.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 5002, 5315 ] }
16,057
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
burn
function burn(uint256 amount) external { require(_balances[msg.sender] >= amount, "ERC20: not enough balance!"); _burn(msg.sender, amount); }
/** * @dev External function to destroys `amount` tokens from `account`, reducing the * total supply. */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 5447, 5618 ] }
16,058
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
_burn
function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amo...
/** * @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.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 5946, 6299 ] }
16,059
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
_approve
function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); }
/** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero...
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 6734, 7077 ] }
16,060
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
ERC20
contract ERC20 is Context, TRC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // allocating 20,000,000 tokens for liquidity, promotions, airdrops uint256 private _totalSupply = 20000000...
/** * @dev Implementation of the {TRC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * ...
NatSpecMultiLine
_burnFrom
function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); }
/** * @dev Destroys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See {_burn} and {_approve}. */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 7258, 7495 ] }
16,061
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
GlobalsAndUtility
contract GlobalsAndUtility is ERC20 { /* XfLobbyEnter */ event XfLobbyEnter( uint256 timestamp, uint256 enterDay, uint256 indexed entryIndex, uint256 indexed rawAmount ); /* XfLobbyExit */ event XfLobbyExit( uint256 timestamp, ...
dailyDataUpdate
function dailyDataUpdate(uint256 beforeDay) external { GlobalsCache memory g; GlobalsCache memory gSnapshot; _globalsLoad(g, gSnapshot); /* Skip pre-claim period */ require(g._currentDay > CLAIM_PHASE_START_DAY, "NUG: Too early"); if (beforeDay != 0) { require(beforeDay ...
/** * @dev PUBLIC FACING: Optionally update daily data for a smaller * range to reduce gas cost for a subsequent operation * @param beforeDay Only update days before this day number (optional; 0 for current day) */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 6819, 7483 ] }
16,062
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
GlobalsAndUtility
contract GlobalsAndUtility is ERC20 { /* XfLobbyEnter */ event XfLobbyEnter( uint256 timestamp, uint256 enterDay, uint256 indexed entryIndex, uint256 indexed rawAmount ); /* XfLobbyExit */ event XfLobbyExit( uint256 timestamp, ...
dailyDataRange
function dailyDataRange(uint256 beginDay, uint256 endDay) external view returns (uint256[] memory _dayStakeSharesTotal, uint256[] memory _dayPayoutTotal, uint256[] memory _dayDividends) { require(beginDay < endDay && endDay <= globals.dailyDataCount, "NUG: range invalid"); _dayStakeSharesTot...
/** * @dev PUBLIC FACING: External helper to return multiple values of daily data with * a single call. * @param beginDay First day of data range * @param endDay Last day (non-inclusive) of data range * @return array of day stake shares total * @return array of day payout total */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 7815, 8742 ] }
16,063
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
GlobalsAndUtility
contract GlobalsAndUtility is ERC20 { /* XfLobbyEnter */ event XfLobbyEnter( uint256 timestamp, uint256 enterDay, uint256 indexed entryIndex, uint256 indexed rawAmount ); /* XfLobbyExit */ event XfLobbyExit( uint256 timestamp, ...
globalInfo
function globalInfo() external view returns (uint256[10] memory) { return [ globals.lockedGunsTotal, globals.nextStakeSharesTotal, globals.shareRate, globals.stakePenaltyTotal, globals.dailyDataCount, globals.stakeSharesTotal, globals...
/** * @dev PUBLIC FACING: External helper to return most global info with a single call. * Ugly implementation due to limitations of the standard ABI encoder. * @return Fixed array of values */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 8970, 9471 ] }
16,064
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
GlobalsAndUtility
contract GlobalsAndUtility is ERC20 { /* XfLobbyEnter */ event XfLobbyEnter( uint256 timestamp, uint256 enterDay, uint256 indexed entryIndex, uint256 indexed rawAmount ); /* XfLobbyExit */ event XfLobbyExit( uint256 timestamp, ...
allocatedSupply
function allocatedSupply() external view returns (uint256) { return totalSupply() + globals.lockedGunsTotal; }
/** * @dev PUBLIC FACING: ERC20 totalSupply() is the circulating supply and does not include any * staked Guns. allocatedSupply() includes both. * @return Allocated Supply in Guns */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 9686, 9847 ] }
16,065
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
GlobalsAndUtility
contract GlobalsAndUtility is ERC20 { /* XfLobbyEnter */ event XfLobbyEnter( uint256 timestamp, uint256 enterDay, uint256 indexed entryIndex, uint256 indexed rawAmount ); /* XfLobbyExit */ event XfLobbyExit( uint256 timestamp, ...
currentDay
function currentDay() external view returns (uint256) { return _currentDay(); }
/** * @dev PUBLIC FACING: External helper for the current day number since launch time * @return Current day number (zero-based) */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 10005, 10135 ] }
16,066
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
GlobalsAndUtility
contract GlobalsAndUtility is ERC20 { /* XfLobbyEnter */ event XfLobbyEnter( uint256 timestamp, uint256 enterDay, uint256 indexed entryIndex, uint256 indexed rawAmount ); /* XfLobbyExit */ event XfLobbyExit( uint256 timestamp, ...
_stakeRemove
function _stakeRemove(StakeStore[] storage stakeListRef, uint256 stakeIndex) internal { uint256 lastIndex = stakeListRef.length - 1; /* Skip the copy if element to be removed is already the last element */ if (stakeIndex != lastIndex) { /* Copy last element to the requested element's "ho...
/** * @dev Efficiently delete from an unordered array by moving the last element * to the "hole" and reducing the array length. Can change the order of the list * and invalidate previously held indexes. * @notice stakeListRef length and stakeIndex are already ensured valid in stakeEnd() * @param stakeListRef ...
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 14729, 15381 ] }
16,067
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
GlobalsAndUtility
contract GlobalsAndUtility is ERC20 { /* XfLobbyEnter */ event XfLobbyEnter( uint256 timestamp, uint256 enterDay, uint256 indexed entryIndex, uint256 indexed rawAmount ); /* XfLobbyExit */ event XfLobbyExit( uint256 timestamp, ...
_estimatePayoutRewardsDay
function _estimatePayoutRewardsDay(GlobalsCache memory g, uint256 stakeSharesParam, uint256 day) internal view returns (uint256 payout) { /* Prevent updating state for this estimation */ GlobalsCache memory gTmp; _globalsCacheSnapshot(g, gTmp); DailyRoundState memory rs; rs._a...
/** * @dev Estimate the stake payout for an incomplete day * @param g Cache of stored globals * @param stakeSharesParam Param from stake to calculate bonuses for * @param day Day to calculate bonuses for * @return Payout in Guns */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 15657, 16368 ] }
16,068
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
StakeableToken
contract StakeableToken is GlobalsAndUtility { /** * @dev PUBLIC FACING: Open a stake. * @param newStakedGuns Number of Guns to stake * @param newStakedDays Number of days to stake */ function stakeStart(uint256 newStakedGuns, uint256 newStakedDays) external { Gl...
stakeStart
function stakeStart(uint256 newStakedGuns, uint256 newStakedDays) external { GlobalsCache memory g; GlobalsCache memory gSnapshot; _globalsLoad(g, gSnapshot); /* Enforce the minimum stake time */ require(newStakedDays >= MIN_STAKE_DAYS, "NUG: newStakedDays lower than minimum"); /...
/** * @dev PUBLIC FACING: Open a stake. * @param newStakedGuns Number of Guns to stake * @param newStakedDays Number of days to stake */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 214, 852 ] }
16,069
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
StakeableToken
contract StakeableToken is GlobalsAndUtility { /** * @dev PUBLIC FACING: Open a stake. * @param newStakedGuns Number of Guns to stake * @param newStakedDays Number of days to stake */ function stakeStart(uint256 newStakedGuns, uint256 newStakedDays) external { Gl...
stakeGoodAccounting
function stakeGoodAccounting(address stakerAddr, uint256 stakeIndex, uint40 stakeIdParam) external { GlobalsCache memory g; GlobalsCache memory gSnapshot; _globalsLoad(g, gSnapshot); /* require() is more informative than the default assert() */ require(stakeLists[stakerAddr].length != 0...
/** * @dev PUBLIC FACING: Unlocks a completed stake, distributing the proceeds of any penalty * immediately. The staker must still call stakeEnd() to retrieve their stake return (if any). * @param stakerAddr Address of staker * @param stakeIndex Index of stake within stake list * @param stakeIdParam The stake...
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 1215, 2990 ] }
16,070
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
StakeableToken
contract StakeableToken is GlobalsAndUtility { /** * @dev PUBLIC FACING: Open a stake. * @param newStakedGuns Number of Guns to stake * @param newStakedDays Number of days to stake */ function stakeStart(uint256 newStakedGuns, uint256 newStakedDays) external { Gl...
stakeEnd
function stakeEnd(uint256 stakeIndex, uint40 stakeIdParam) external { GlobalsCache memory g; GlobalsCache memory gSnapshot; _globalsLoad(g, gSnapshot); StakeStore[] storage stakeListRef = stakeLists[msg.sender]; /* require() is more informative than the default assert() */ requir...
/** * @dev PUBLIC FACING: Closes a stake. The order of the stake list can change so * a stake id is used to reject stale indexes. * @param stakeIndex Index of stake within stake list * @param stakeIdParam The stake's id */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 3251, 6037 ] }
16,071
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
StakeableToken
contract StakeableToken is GlobalsAndUtility { /** * @dev PUBLIC FACING: Open a stake. * @param newStakedGuns Number of Guns to stake * @param newStakedDays Number of days to stake */ function stakeStart(uint256 newStakedGuns, uint256 newStakedDays) external { Gl...
stakeCount
function stakeCount(address stakerAddr) external view returns (uint256) { return stakeLists[stakerAddr].length; }
/** * @dev PUBLIC FACING: Return the current stake count for a staker address * @param stakerAddr Address of staker */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 6182, 6346 ] }
16,072
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
StakeableToken
contract StakeableToken is GlobalsAndUtility { /** * @dev PUBLIC FACING: Open a stake. * @param newStakedGuns Number of Guns to stake * @param newStakedDays Number of days to stake */ function stakeStart(uint256 newStakedGuns, uint256 newStakedDays) external { Gl...
_stakeStart
function _stakeStart( GlobalsCache memory g, uint256 newStakedGuns, uint256 newStakedDays ) internal { /* Enforce the maximum stake time */ require(newStakedDays <= MAX_STAKE_DAYS, "NUG: Max allowed staking days: 180"); uint256 bonusGuns = _stakeStartBonusGuns(newStakedGuns, newSt...
/** * @dev Open a stake. * @param g Cache of stored globals * @param newStakedGuns Number of Guns to stake * @param newStakedDays Number of days to stake */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 6541, 8283 ] }
16,073
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
StakeableToken
contract StakeableToken is GlobalsAndUtility { /** * @dev PUBLIC FACING: Open a stake. * @param newStakedGuns Number of Guns to stake * @param newStakedDays Number of days to stake */ function stakeStart(uint256 newStakedGuns, uint256 newStakedDays) external { Gl...
_calcPayoutRewards
function _calcPayoutRewards( GlobalsCache memory g, uint256 stakeSharesParam, uint256 beginDay, uint256 endDay ) private view returns (uint256 payout) { uint256 counter; for (uint256 day = beginDay; day < endDay; day++) { uint256 dayPayout; dayPayout ...
/** * @dev Calculates total stake payout including rewards for a multi-day range * @param g Cache of stored globals * @param stakeSharesParam Param from stake to calculate bonuses for * @param beginDay First day to calculate bonuses for * @param endDay Last day (non-inclusive) of range to calculate bonuses fo...
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 8673, 9576 ] }
16,074
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
StakeableToken
contract StakeableToken is GlobalsAndUtility { /** * @dev PUBLIC FACING: Open a stake. * @param newStakedGuns Number of Guns to stake * @param newStakedDays Number of days to stake */ function stakeStart(uint256 newStakedGuns, uint256 newStakedDays) external { Gl...
_calcPayoutDividendsReward
function _calcPayoutDividendsReward( GlobalsCache memory g, uint256 stakeSharesParam, uint256 beginDay, uint256 endDay ) private view returns (uint256 payout) { for (uint256 day = beginDay; day < endDay; day++) { uint256 dayPayout; /* user's share of 85% o...
/** * @dev Calculates user dividends * @param g Cache of stored globals * @param stakeSharesParam Param from stake to calculate bonuses for * @param beginDay First day to calculate bonuses for * @param endDay Last day (non-inclusive) of range to calculate bonuses for * @return Payout in Guns */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 9922, 10575 ] }
16,075
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
StakeableToken
contract StakeableToken is GlobalsAndUtility { /** * @dev PUBLIC FACING: Open a stake. * @param newStakedGuns Number of Guns to stake * @param newStakedDays Number of days to stake */ function stakeStart(uint256 newStakedGuns, uint256 newStakedDays) external { Gl...
_stakeStartBonusGuns
function _stakeStartBonusGuns(uint256 newStakedGuns, uint256 newStakedDays) private pure returns (uint256 bonusGuns) { /* LONGER PAYS BETTER: If longer than 1 day stake is committed to, each extra day gives bonus shares of approximately 0.0548%, which is approximately 2...
/** * @dev Calculate bonus Guns for a new stake, if any * @param newStakedGuns Number of Guns to stake * @param newStakedDays Number of days to stake */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 10760, 13552 ] }
16,076
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
TransformableToken
contract TransformableToken is StakeableToken { /** * @dev PUBLIC FACING: Enter the auction lobby for the current round * @param referrerAddr TRX address of referring user (optional; 0x0 for no referrer) */ function xfLobbyEnter(address referrerAddr) external payable {...
xfLobbyEnter
function xfLobbyEnter(address referrerAddr) external payable { uint256 enterDay = _currentDay(); uint256 rawAmount = msg.value; require(rawAmount != 0, "NUG: Amount required"); XfLobbyQueueStore storage qRef = xfLobbyMembers[enterDay][msg.sender]; uint256 entryIndex = qRef.tail...
/** * @dev PUBLIC FACING: Enter the auction lobby for the current round * @param referrerAddr TRX address of referring user (optional; 0x0 for no referrer) */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 231, 882 ] }
16,077
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
TransformableToken
contract TransformableToken is StakeableToken { /** * @dev PUBLIC FACING: Enter the auction lobby for the current round * @param referrerAddr TRX address of referring user (optional; 0x0 for no referrer) */ function xfLobbyEnter(address referrerAddr) external payable {...
xfLobbyExit
function xfLobbyExit(uint256 enterDay, uint256 count) external { require(enterDay < _currentDay(), "NUG: Round is not complete"); XfLobbyQueueStore storage qRef = xfLobbyMembers[enterDay][msg.sender]; uint256 headIndex = qRef.headIndex; uint256 endIndex; if (count != 0) { r...
/** * @dev PUBLIC FACING: Leave the transform lobby after the round is complete * @param enterDay Day number when the member entered * @param count Number of queued-enters to exit (optional; 0 for all) */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 1119, 3063 ] }
16,078
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
TransformableToken
contract TransformableToken is StakeableToken { /** * @dev PUBLIC FACING: Enter the auction lobby for the current round * @param referrerAddr TRX address of referring user (optional; 0x0 for no referrer) */ function xfLobbyEnter(address referrerAddr) external payable {...
xfLobbyRange
function xfLobbyRange(uint256 beginDay, uint256 endDay) external view returns (uint256[] memory list) { require( beginDay < endDay && endDay <= _currentDay(), "NUG: invalid range" ); list = new uint256[](endDay - beginDay); uint256 src = beginDay; uint256 d...
/** * @dev PUBLIC FACING: External helper to return multiple values of xfLobby[] with * a single call * @param beginDay First day of data range * @param endDay Last day (non-inclusive) of data range * @return Fixed array of values */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 3341, 3847 ] }
16,079
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
TransformableToken
contract TransformableToken is StakeableToken { /** * @dev PUBLIC FACING: Enter the auction lobby for the current round * @param referrerAddr TRX address of referring user (optional; 0x0 for no referrer) */ function xfLobbyEnter(address referrerAddr) external payable {...
xfFlush
function xfFlush() external { GlobalsCache memory g; GlobalsCache memory gSnapshot; _globalsLoad(g, gSnapshot); require(address(this).balance != 0, "NUG: No value"); require(LAST_FLUSHED_DAY < _currentDay(), "NUG: Invalid day"); _dailyDataUpdateAuto(g); NUI_SHARE...
/** * @dev PUBLIC FACING: Release 15% for NUI Drip from daily divs */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 3937, 4445 ] }
16,080
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
TransformableToken
contract TransformableToken is StakeableToken { /** * @dev PUBLIC FACING: Enter the auction lobby for the current round * @param referrerAddr TRX address of referring user (optional; 0x0 for no referrer) */ function xfLobbyEnter(address referrerAddr) external payable {...
xfLobbyEntry
function xfLobbyEntry(address memberAddr, uint256 enterDay, uint256 entryIndex) external view returns (uint256 rawAmount, address referrerAddr) { XfLobbyEntryStore storage entry = xfLobbyMembers[enterDay][memberAddr].entries[entryIndex]; require(entry.rawAmount != 0, "NUG: Param invalid"); ...
/** * @dev PUBLIC FACING: Return a current lobby member queue entry. * Only needed due to limitations of the standard ABI encoder. * @param memberAddr TRX address of the lobby member * @param enterDay * @param entryIndex * @return 1: Raw amount that was entered with; 2: Referring TRX addr (optional; 0x0 f...
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 4822, 5233 ] }
16,081
NUG
NUG.sol
0xa15a5fae698e02efeccd38b33107de7253a44e02
Solidity
TransformableToken
contract TransformableToken is StakeableToken { /** * @dev PUBLIC FACING: Enter the auction lobby for the current round * @param referrerAddr TRX address of referring user (optional; 0x0 for no referrer) */ function xfLobbyEnter(address referrerAddr) external payable {...
xfLobbyPendingDays
function xfLobbyPendingDays(address memberAddr) external view returns (uint256[XF_LOBBY_DAY_WORDS] memory words) { uint256 day = _currentDay() + 1; while (day-- != 0) { if (xfLobbyMembers[day][memberAddr].tailIndex > xfLobbyMembers[day][memberAddr].headIndex) { words[da...
/** * @dev PUBLIC FACING: Return the lobby days that a user is in with a single call * @param memberAddr TRX address of the user * @return Bit vector of lobby day numbers */
NatSpecMultiLine
v0.5.10+commit.5a6ea5b1
None
bzzr://3c0ae5e6cbd2048e452b0d2948aada211cfe1c29034996aa28137d11fe31bf17
{ "func_code_index": [ 5439, 5882 ] }
16,082
Holder
@openzeppelin/contracts/utils/introspection/ERC165.sol
0x7400e57dffdf7ff2c72618edbca0b2e48d2ae0da
Solidity
ERC165
abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
/** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interface...
NatSpecMultiLine
supportsInterface
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; }
/** * @dev See {IERC165-supportsInterface}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://813b05344641e3b98807517362f9fe63990468b23583a17cc8d2a35e31efcf85
{ "func_code_index": [ 103, 315 ] }
16,083
Holder
@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol
0x7400e57dffdf7ff2c72618edbca0b2e48d2ae0da
Solidity
ERC1155Receiver
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return ...
/** * @dev _Available since v3.1._ */
NatSpecMultiLine
supportsInterface
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); }
/** * @dev See {IERC165-supportsInterface}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://813b05344641e3b98807517362f9fe63990468b23583a17cc8d2a35e31efcf85
{ "func_code_index": [ 129, 433 ] }
16,084
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
burn
function burn( address user, address receiverOfUnderlying, uint256 amount, uint256 index ) external override onlyLendingPool { uint256 amountScaled = amount.rayDiv(index); require(amountScaled != 0, Errors.CT_INVALID_BURN_AMOUNT); ExtData memory e = _fetchExtData(); _burnScaled(user, amountScaled, e); ...
/** * @dev Burns aTokens from `user` and sends the equivalent amount of underlying to `receiverOfUnderlying` * - Only callable by the LendingPool, as extra state updates there need to be managed * @param user The owner of the aTokens, getting them burned * @param receiverOfUnderlying The address that will receive t...
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 3866, 4519 ] }
16,085
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
mint
function mint( address user, uint256 amount, uint256 index ) external override onlyLendingPool returns (bool) { uint256 previousBalanceInternal = super.balanceOf(user); uint256 amountScaled = amount.rayDiv(index); require(amountScaled != 0, Errors.CT_INVALID_MINT_AMOUNT); ExtData memory e = _fetchExtDat...
/** * @dev Mints `amount` aTokens to `user` * - Only callable by the LendingPool, as extra state updates there need to be managed * @param user The address receiving the minted tokens * @param amount The amount of tokens getting minted * @param index The new liquidity index of the reserve * @return `true` if the ...
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 4900, 5534 ] }
16,086
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
mintToTreasury
function mintToTreasury(uint256 amount, uint256 index) external override onlyLendingPool { if (amount == 0) { return; } // Compared to the normal mint, we don't check for rounding errors. // The amount to mint can easily be very small since it is a fraction of the interest accrued. // In that case, the t...
/** * @dev Mints aTokens to the reserve treasury * - Only callable by the LendingPool * @param amount The amount of tokens getting minted * @param index The new liquidity index of the reserve */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 5748, 6657 ] }
16,087
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
transferOnLiquidation
function transferOnLiquidation( address from, address to, uint256 value ) external override onlyLendingPool { // Being a normal transfer, the Transfer() and BalanceTransfer() are emitted // so no need to emit a specific event here _transfer(from, to, value, false); emit Transfer(from, to, value); }
/** * @dev Transfers aTokens in the event of a borrow being liquidated, in case the liquidators reclaims the aToken * - Only callable by the LendingPool * @param from The address getting liquidated, current owner of the aTokens * @param to The recipient * @param value The amount of tokens getting transferred **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 6993, 7327 ] }
16,088
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
transferUnderlyingTo
function transferUnderlyingTo(address target, uint256 amount) external override onlyLendingPool returns (uint256) { IERC20(UNDERLYING_ASSET_ADDRESS).safeTransfer(target, amount); return amount; }
/** * @dev Transfers the underlying asset to `target`. Used by the LendingPool to transfer * assets in borrow(), withdraw() and flashLoan() * @param target The recipient of the aTokens * @param amount The amount getting transferred * @return The amount transferred **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 7618, 7843 ] }
16,089
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
permit
function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external { require(owner != address(0), 'INVALID_OWNER'); //solium-disable-next-line require(block.timestamp <= deadline, 'INVALID_EXPIRATION'); uint256 currentValidNonce = _nonces[own...
/** * @dev implements the permit function as for * https://github.com/ethereum/EIPs/blob/8a34d644aacf0f9f8f00815307fd7dd5da07655f/EIPS/eip-2612.md * @param owner The owner of the funds * @param spender The spender * @param value The amount * @param deadline The deadline timestamp, type(uint256).max for max deadli...
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 8278, 9021 ] }
16,090
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
_transfer
function _transfer( address from, address to, uint256 amount, bool validate ) internal { uint256 index = POOL.getReserveNormalizedIncome(UNDERLYING_ASSET_ADDRESS); uint256 amountScaled = amount.rayDiv(index); ExtData memory e = _fetchExtData(); uint256 totalSupplyInternal = super.totalSupply(); uint...
/** * @dev Transfers the aTokens between two users. Validates the transfer * (ie checks for valid HF after the transfer) if required * @param from The source address * @param to The destination address * @param amount The amount getting transferred * @param validate `true` if the transfer needs to be validated *...
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 9362, 10417 ] }
16,091
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
scaledTotalSupply
function scaledTotalSupply() public view virtual override returns (uint256) { return _scaledTotalSupply(_fetchExtData(), _totalGonsDeposited); }
/** * @dev Returns the scaled total supply of the variable debt token. Represents sum(debt/index) * aka, scaledTotalSupply = (totalGonsDeposited - totalGonsBorrowed) / Λ + totalPrincipalBorrowed * @return the scaled total supply **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 10914, 11066 ] }
16,092
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
scaledBalanceOf
function scaledBalanceOf(address user) external view override returns (uint256) { return _scaledBalanceOf( super.balanceOf(user), super.totalSupply(), _scaledTotalSupply(_fetchExtData(), _totalGonsDeposited) ); }
/** * @dev Returns the scaled balance of the user. The scaled balance is the sum of all the * updated stored balance divided by the reserve's liquidity index at the moment of the update. * aka, userBalanceScaled = userBalanceInternal/totalSupplyInternal * scaledTotalSupply * @param user The user whose bal...
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 11468, 11704 ] }
16,093
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
getScaledUserBalanceAndSupply
function getScaledUserBalanceAndSupply(address user) external view override returns (uint256, uint256) { uint256 scaledTotalSupply = _scaledTotalSupply(_fetchExtData(), _totalGonsDeposited); return ( _scaledBalanceOf(super.balanceOf(user), super.totalSupply(), scaledTotalSupply), scaledTotalSupply ...
/** * @dev Returns the scaled balance of the user and the scaled total supply. * @param user The address of the user * @return The scaled balance of the user * @return The scaled balance and the scaled total supply **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 11942, 12291 ] }
16,094
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
totalSupply
function totalSupply() public view override(IncentivizedERC20, IERC20) returns (uint256) { uint256 currentSupplyScaled = _scaledTotalSupply(_fetchExtData(), _totalGonsDeposited); if (currentSupplyScaled == 0) { // currentSupplyInternal should also be zero in this case (super.totalSupply()) return 0; } ...
/** * @dev calculates the total supply of the specific aToken * since the balance of every single user increases over time, the total supply * does that too. * @return the current total supply **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 12507, 12939 ] }
16,095
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
balanceOf
function balanceOf(address user) public view override(IncentivizedERC20, IERC20) returns (uint256) { uint256 userBalanceScaled = _scaledBalanceOf( super.balanceOf(user), super.totalSupply(), _scaledTotalSupply(_fetchExtData(), _totalGonsDeposited) ); return userBalanceScaled.rayMul(POOL.getReserve...
/** * @dev Calculates the balance of the user: principal balance + interest generated by the principal * @param user The user whose balance is calculated * @return The balance of the user **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 13147, 13537 ] }
16,096
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
_transferScaled
function _transferScaled(address from, address to, uint256 transferAmountScaled, ExtData memory e) private returns (uint256) { uint256 totalSupplyInternal = super.totalSupply(); uint256 scaledTotalSupply = _scaledTotalSupply(e, _totalGonsDeposited); uint256 transferAmountInternal = transferAmountScaled.mul(totalS...
/** * @dev transferAmountInternal = (transferAmountScaled * totalSupplyInternal) / scaledTotalSupply **/
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 13761, 14186 ] }
16,097
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
_mintScaled
function _mintScaled(address user, uint256 mintAmountScaled, ExtData memory e) private { uint256 totalSupplyInternalBefore = super.totalSupply(); uint256 userBalanceInternalBefore = super.balanceOf(user); // First mint if(totalSupplyInternalBefore == 0) { uint256 mintAmountInternal = _amplToGons(e.totalAMP...
/** * @dev mintAmountInternal is mint such that the following holds true * * (userBalanceInternalBefore+mintAmountInternal)/(totalSupplyInternalBefore+mintAmountInternal) * = (userBalanceScaledBefore+mintAmountScaled)/(scaledTotalSupplyBefore+mintAmountScaled) * * scaledTotalSupplyAfter = scaledTotalSupplyBefo...
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 14858, 16256 ] }
16,098
AAmplToken
contracts/protocol/tokenization/ampl/AAmplToken.sol
0x6fbc3be5ee5273598d1491d41bb45f6d05a7541a
Solidity
AAmplToken
contract AAmplToken is VersionedInitializable, IncentivizedERC20, IAToken { using WadRayMath for uint256; using SafeERC20 for IERC20; using UInt256Lib for uint256; using SignedSafeMath for int256; bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('E...
/** @title Aave-AMPL ERC20 AToken @dev Implementation of the interest bearing AMPL token for the Aave protocol @author AmpleforthOrg The AMPL AToken externally behaves similar to every other aTOKEN. It always maintains a 1:1 peg with the underlying AMPL. The following should always be true. 1) At any time, ...
NatSpecMultiLine
_burnScaled
function _burnScaled(address user, uint256 burnAmountScaled, ExtData memory e) private { uint256 totalSupplyInternalBefore = super.totalSupply(); uint256 userBalanceInternalBefore = super.balanceOf(user); uint256 scaledTotalSupplyBefore = _scaledTotalSupply(e, _totalGonsDeposited); uint256 userBalanceScaledBef...
/** * @dev burnAmountInternal is burnt such that the following holds true * * (userBalanceInternalBefore-burnAmountInternal)/(totalSupplyInternalBefore-burnAmountInternal) * = (userBalanceScaledBefore-burnAmountScaled)/(scaledTotalSupplyBefore-burnAmountScaled) * * scaledTotalSupplyAfter = scaledTotalSupplyBef...
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 16929, 18121 ] }
16,099