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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | sub | function sub (int128 x, int128 y) internal pure returns (int128) {
int256 result = int256(x) - y;
require (result >= MIN_64x64 && result <= MAX_64x64);
return int128 (result);
}
| /**
* Calculate x - y. Revert on overflow.
*
* @param x signed 64.64-bit fixed point number
* @param y signed 64.64-bit fixed point number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3194,
3392
]
} | 500 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | mul | function mul (int128 x, int128 y) internal pure returns (int128) {
int256 result = int256(x) * y >> 64;
require (result >= MIN_64x64 && result <= MAX_64x64);
return int128 (result);
}
| /**
* Calculate x * y rounding down. Revert on overflow.
*
* @param x signed 64.64-bit fixed point number
* @param y signed 64.64-bit fixed point number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3625,
3829
]
} | 501 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | muli | function muli (int128 x, int256 y) internal pure returns (int256) {
if (x == MIN_64x64) {
require (y >= -0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF &&
y <= 0x1000000000000000000000000000000000000000000000000);
return -y << 63;
} else {
bool negativeResult = false;
if (x < 0) {
... | /**
* Calculate x * y rounding towards zero, where x is signed 64.64 fixed point
* number and y is signed 256-bit integer number. Revert on overflow.
*
* @param x signed 64.64 fixed point number
* @param y signed 256-bit integer number
* @return signed 256-bit integer number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
4143,
5135
]
} | 502 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | mulu | function mulu (int128 x, uint256 y) internal pure returns (uint256) {
if (y == 0) return 0;
require (x >= 0);
uint256 lo = (uint256 (x) * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) >> 64;
uint256 hi = uint256 (x) * (y >> 128);
require (hi <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
hi... | /**
* Calculate x * y rounding down, where x is signed 64.64 fixed point number
* and y is unsigned 256-bit integer number. Revert on overflow.
*
* @param x signed 64.64 fixed point number
* @param y unsigned 256-bit integer number
* @return unsigned 256-bit integer number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
5447,
5919
]
} | 503 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | div | function div (int128 x, int128 y) internal pure returns (int128) {
require (y != 0);
int256 result = (int256 (x) << 64) / y;
require (result >= MIN_64x64 && result <= MAX_64x64);
return int128 (result);
}
| /**
* Calculate x / y rounding towards zero. Revert on overflow or when y is
* zero.
*
* @param x signed 64.64-bit fixed point number
* @param y signed 64.64-bit fixed point number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
6184,
6414
]
} | 504 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | divi | function divi (int256 x, int256 y) internal pure returns (int128) {
require (y != 0);
bool negativeResult = false;
if (x < 0) {
x = -x; // We rely on overflow behavior here
negativeResult = true;
}
if (y < 0) {
y = -y; // We rely on overflow behavior here
negativeResult = !negativeR... | /**
* Calculate x / y rounding towards zero, where x and y are signed 256-bit
* integer numbers. Revert on overflow or when y is zero.
*
* @param x signed 256-bit integer number
* @param y signed 256-bit integer number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
6717,
7483
]
} | 505 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | divu | function divu (uint256 x, uint256 y) internal pure returns (int128) {
require (y != 0);
uint128 result = divuu (x, y);
require (result <= uint128 (MAX_64x64));
return int128 (result);
}
| /**
* Calculate x / y rounding towards zero, where x and y are unsigned 256-bit
* integer numbers. Revert on overflow or when y is zero.
*
* @param x unsigned 256-bit integer number
* @param y unsigned 256-bit integer number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
7792,
8003
]
} | 506 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | neg | function neg (int128 x) internal pure returns (int128) {
require (x != MIN_64x64);
return -x;
}
| /**
* Calculate -x. Revert on overflow.
*
* @param x signed 64.64-bit fixed point number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
8168,
8279
]
} | 507 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | abs | function abs (int128 x) internal pure returns (int128) {
require (x != MIN_64x64);
return x < 0 ? -x : x;
}
| /**
* Calculate |x|. Revert on overflow.
*
* @param x signed 64.64-bit fixed point number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
8445,
8568
]
} | 508 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | inv | function inv (int128 x) internal pure returns (int128) {
require (x != 0);
int256 result = int256 (0x100000000000000000000000000000000) / x;
require (result >= MIN_64x64 && result <= MAX_64x64);
return int128 (result);
}
| /**
* Calculate 1 / x rounding towards zero. Revert on overflow or when x is
* zero.
*
* @param x signed 64.64-bit fixed point number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
8782,
9028
]
} | 509 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | avg | function avg (int128 x, int128 y) internal pure returns (int128) {
return int128 ((int256 (x) + int256 (y)) >> 1);
}
| /**
* Calculate arithmetics average of x and y, i.e. (x + y) / 2 rounding down.
*
* @param x signed 64.64-bit fixed point number
* @param y signed 64.64-bit fixed point number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
9283,
9410
]
} | 510 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | gavg | function gavg (int128 x, int128 y) internal pure returns (int128) {
int256 m = int256 (x) * int256 (y);
require (m >= 0);
require (m <
0x4000000000000000000000000000000000000000000000000000000000000000);
return int128 (sqrtu (uint256 (m), uint256 (x) + uint256 (y) >> 1));
}
| /**
* Calculate geometric average of x and y, i.e. sqrt (x * y) rounding down.
* Revert on overflow or in case x * y is negative.
*
* @param x signed 64.64-bit fixed point number
* @param y signed 64.64-bit fixed point number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
9719,
10028
]
} | 511 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | pow | function pow (int128 x, uint256 y) internal pure returns (int128) {
uint256 absoluteResult;
bool negativeResult = false;
if (x >= 0) {
absoluteResult = powu (uint256 (x) << 63, y);
} else {
// We rely on overflow behavior here
absoluteResult = powu (uint256 (uint128 (-x)) << 63, y);
nega... | /**
* Calculate x^y assuming 0^0 is 1, where x is signed 64.64 fixed point number
* and y is unsigned 256-bit integer number. Revert on overflow.
*
* @param x signed 64.64-bit fixed point number
* @param y uint256 value
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
10332,
11081
]
} | 512 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | sqrt | function sqrt (int128 x) internal pure returns (int128) {
require (x >= 0);
return int128 (sqrtu (uint256 (x) << 64, 0x10000000000000000));
}
| /**
* Calculate sqrt (x) rounding down. Revert if x < 0.
*
* @param x signed 64.64-bit fixed point number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
11263,
11420
]
} | 513 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | log_2 | function log_2 (int128 x) internal pure returns (int128) {
require (x > 0);
int256 msb = 0;
int256 xc = x;
if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; }
if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
if (xc >= 0x10000) { xc >>= 16; msb += 16; }
if (xc >= 0x100) { xc >>= 8; msb += 8; ... | /**
* Calculate binary logarithm of x. Revert if x <= 0.
*
* @param x signed 64.64-bit fixed point number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
11602,
12387
]
} | 514 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | ln | function ln (int128 x) internal pure returns (int128) {
require (x > 0);
return int128 (
uint256 (log_2 (x)) * 0xB17217F7D1CF79ABC9E3B39803F2F6AF >> 128);
}
| /**
* Calculate natural logarithm of x. Revert if x <= 0.
*
* @param x signed 64.64-bit fixed point number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
12570,
12753
]
} | 515 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | exp_2 | function exp_2 (int128 x) internal pure returns (int128) {
require (x < 0x400000000000000000); // Overflow
if (x < -0x400000000000000000) return 0; // Underflow
uint256 result = 0x80000000000000000000000000000000;
if (x & 0x8000000000000000 > 0)
result = result * 0x16A09E667F3BCC908B2FB1366EA957D... | /**
* Calculate binary exponent of x. Revert on overflow.
*
* @param x signed 64.64-bit fixed point number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
12936,
19593
]
} | 516 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | exp | function exp (int128 x) internal pure returns (int128) {
require (x < 0x400000000000000000); // Overflow
if (x < -0x400000000000000000) return 0; // Underflow
return exp_2 (
int128 (int256 (x) * 0x171547652B82FE1777D0FFDA0D23A7D12 >> 128));
}
| /**
* Calculate natural exponent of x. Revert on overflow.
*
* @param x signed 64.64-bit fixed point number
* @return signed 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
19777,
20053
]
} | 517 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | divuu | function divuu (uint256 x, uint256 y) private pure returns (uint128) {
require (y != 0);
uint256 result;
if (x <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
result = (x << 64) / y;
else {
uint256 msb = 192;
uint256 xc = x >> 192;
if (xc >= 0x100000000) { xc >>= 32; msb += 32... | /**
* Calculate x / y rounding towards zero, where x and y are unsigned 256-bit
* integer numbers. Revert on overflow or when y is zero.
*
* @param x unsigned 256-bit integer number
* @param y unsigned 256-bit integer number
* @return unsigned 64.64-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
20364,
21624
]
} | 518 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | powu | function powu (uint256 x, uint256 y) private pure returns (uint256) {
if (y == 0) return 0x80000000000000000000000000000000;
else if (x == 0) return 0;
else {
int256 msb = 0;
uint256 xc = x;
if (xc >= 0x100000000000000000000000000000000) { xc >>= 128; msb += 128; }
if (xc >= 0x1000000000000... | /**
* Calculate x^y assuming 0^0 is 1, where x is unsigned 129.127 fixed point
* number and y is unsigned 256-bit integer number. Revert on overflow.
*
* @param x unsigned 129.127-bit fixed point number
* @param y uint256 value
* @return unsigned 129.127-bit fixed point number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
21940,
23680
]
} | 519 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ABDKMath64x64 | library ABDKMath64x64 {
/**
* @dev Minimum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;
/**
* @dev Maximum value signed 64.64-bit fixed point number may have.
*/
int128 private constant MAX_64x64 = 0x7FFFF... | /**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is
* basically a simple fraction whose numerator is signed 128-bit integer and
* denominator is 2^64. As long as denominator is always the same, there is no
* nee... | NatSpecMultiLine | sqrtu | function sqrtu (uint256 x, uint256 r) private pure returns (uint128) {
if (x == 0) return 0;
else {
require (r > 0);
while (true) {
uint256 rr = x / r;
if (r == rr || r + 1 == rr) return uint128 (r);
else if (r == rr + 1) return uint128 (rr);
r = r + rr + 1 >> 1;
}
}
... | /**
* Calculate sqrt (x) rounding down, where x is unsigned 256-bit integer
* number.
*
* @param x unsigned 256-bit integer number
* @return unsigned 128-bit integer number
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
23886,
24233
]
} | 520 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() external view returns (uint256);
| /**
* @dev Returns the amount of tokens in existence.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
90,
149
]
} | 521 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address account) external view returns (uint256);
| /**
* @dev Returns the amount of tokens owned by `account`.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
228,
300
]
} | 522 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
516,
597
]
} | 523 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | allowance | function allowance(address owner, address spender) external view returns (uint256);
| /**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
868,
955
]
} | 524 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) external returns (bool);
| /**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* tra... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1604,
1682
]
} | 525 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1985,
2086
]
} | 526 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXVaultForLP | interface ICoFiXVaultForLP {
enum POOL_STATE {INVALID, ENABLED, DISABLED}
event NewPoolAdded(address pool, uint256 index);
event PoolEnabled(address pool);
event PoolDisabled(address pool);
function setGovernance(address _new) external;
function setInitCoFiRate(uint256 _new) external;
fun... | // | LineComment | stakingPoolForPair | function stakingPoolForPair(address pair) external view returns (address pool);
| /// @dev Get the award staking pool address of pair (XToken)
/// @param pair The address of XToken(pair) contract
/// @return pool The pool address | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1331,
1414
]
} | 527 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | rewardsVault | function rewardsVault() external view returns (address);
| /// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
161,
221
]
} | 528 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | lastBlockRewardApplicable | function lastBlockRewardApplicable() external view returns (uint256);
| /// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-chain | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
325,
398
]
} | 529 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | rewardPerToken | function rewardPerToken() external view returns (uint256);
| /// @dev Reward amount represents by per staking token | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
459,
521
]
} | 530 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | earned | function earned(address account) external view returns (uint256);
| /// @dev How many reward tokens a user has earned but not claimed at present
/// @param account The target account
/// @return The amount of reward tokens a user earned | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
705,
774
]
} | 531 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | accrued | function accrued() external view returns (uint256);
| /// @dev How many reward tokens accrued recently
/// @return The amount of reward tokens accrued recently | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
890,
945
]
} | 532 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | rewardRate | function rewardRate() external view returns (uint256);
| /// @dev Get the latest reward rate of this mining pool (tokens amount per block)
/// @return The latest reward rate | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1072,
1130
]
} | 533 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | totalSupply | function totalSupply() external view returns (uint256);
| /// @dev How many stakingToken (XToken) deposited into to this reward pool (mining pool)
/// @return The total amount of XTokens deposited in this mining pool | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1299,
1358
]
} | 534 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | balanceOf | function balanceOf(address account) external view returns (uint256);
| /// @dev How many stakingToken (XToken) deposited by the target account
/// @param account The target account
/// @return The total amount of XToken deposited in this mining pool | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1552,
1624
]
} | 535 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | stakingToken | function stakingToken() external view returns (address);
| /// @dev Get the address of token for staking in this mining pool
/// @return The staking token address | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1738,
1798
]
} | 536 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | rewardsToken | function rewardsToken() external view returns (address);
| /// @dev Get the address of token for rewards in this mining pool
/// @return The rewards token address | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1912,
1972
]
} | 537 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | stake | function stake(uint256 amount) external;
| /// @dev Stake/Deposit into the reward pool (mining pool)
/// @param amount The target amount | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2094,
2138
]
} | 538 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | stakeForOther | function stakeForOther(address other, uint256 amount) external;
| /// @dev Stake/Deposit into the reward pool (mining pool) for other account
/// @param other The target account
/// @param amount The target amount | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2302,
2369
]
} | 539 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | withdraw | function withdraw(uint256 amount) external;
| /// @dev Withdraw from the reward pool (mining pool), get the original tokens back
/// @param amount The target amount | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2499,
2546
]
} | 540 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | emergencyWithdraw | function emergencyWithdraw() external;
| /// @dev Withdraw without caring about rewards. EMERGENCY ONLY. | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2616,
2658
]
} | 541 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | getReward | function getReward() external;
| /// @dev Claim the reward the user earned | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2706,
2740
]
} | 542 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | exit | function exit() external;
| /// @dev User exit the reward pool, it's actually withdraw and getReward | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2863,
2892
]
} | 543 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXStakingRewards | interface ICoFiXStakingRewards {
// Views
/// @dev The rewards vault contract address set in factory contract
/// @return Returns the vault address
function rewardsVault() external view returns (address);
/// @dev The lastBlock reward applicable
/// @return Returns the latest block.number on-c... | // | LineComment | addReward | function addReward(uint256 amount) external;
| /// @dev Add reward to the mining pool | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2937,
2985
]
} | 544 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiToken | interface ICoFiToken is IERC20 {
/// @dev An event thats emitted when a new governance account is set
/// @param _new The new governance address
event NewGovernance(address _new);
/// @dev An event thats emitted when a new minter account is added
/// @param _minter The new minter address added
... | // | LineComment | setGovernance | function setGovernance(address _new) external;
| /// @dev Set governance address of CoFi token. Only governance has the right to execute.
/// @param _new The new governance address | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
664,
714
]
} | 545 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiToken | interface ICoFiToken is IERC20 {
/// @dev An event thats emitted when a new governance account is set
/// @param _new The new governance address
event NewGovernance(address _new);
/// @dev An event thats emitted when a new minter account is added
/// @param _minter The new minter address added
... | // | LineComment | addMinter | function addMinter(address _minter) external;
| /// @dev Add a new minter account to CoFi token, who can mint tokens. Only governance has the right to execute.
/// @param _minter The new minter address | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
879,
928
]
} | 546 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiToken | interface ICoFiToken is IERC20 {
/// @dev An event thats emitted when a new governance account is set
/// @param _new The new governance address
event NewGovernance(address _new);
/// @dev An event thats emitted when a new minter account is added
/// @param _minter The new minter address added
... | // | LineComment | removeMinter | function removeMinter(address _minter) external;
| /// @dev Remove a minter account from CoFi token, who can mint tokens. Only governance has the right to execute.
/// @param _minter The minter address removed | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1098,
1150
]
} | 547 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiToken | interface ICoFiToken is IERC20 {
/// @dev An event thats emitted when a new governance account is set
/// @param _new The new governance address
event NewGovernance(address _new);
/// @dev An event thats emitted when a new minter account is added
/// @param _minter The new minter address added
... | // | LineComment | mint | function mint(address _to, uint256 _amount) external;
| /// @dev mint is used to distribute CoFi token to users, minters are CoFi mining pools
/// @param _to The receiver address
/// @param _amount The amount of tokens minted | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1336,
1393
]
} | 548 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | ICoFiXFactory | interface ICoFiXFactory {
// All pairs: {ETH <-> ERC20 Token}
event PairCreated(address indexed token, address pair, uint256);
event NewGovernance(address _new);
event NewController(address _new);
event NewFeeReceiver(address _new);
event NewVaultForLP(address _new);
event NewVaultForTrader(... | // | LineComment | createPair | function createPair(
address token
)
external
returns (address pair);
| /// @dev Create a new token pair for trading
/// @param token the address of token to trade
/// @return pair the address of new token pair | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
530,
635
]
} | 549 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | CoFiXVaultForLP | contract CoFiXVaultForLP is ICoFiXVaultForLP, ReentrancyGuard {
using SafeMath for uint256;
uint256 public constant RATE_BASE = 1e18;
uint256 public constant WEIGHT_BASE = 100;
address public immutable cofiToken;
address public immutable factory;
uint256 public immutable genesisBlock;
/... | //
// Reward Pool Controller for Liquidity Provider | LineComment | setGovernance | function setGovernance(address _new) external override onlyGovernance {
governance = _new;
}
| /* setters for protocol governance */ | Comment | v0.6.12+commit.27d51765 | {
"func_code_index": [
1311,
1419
]
} | 550 | ||
CoFiXVaultForLP | CoFiXVaultForLP.sol | 0xbc99a5e7764792cd1024fd5310e9867ee578c23d | Solidity | CoFiXVaultForLP | contract CoFiXVaultForLP is ICoFiXVaultForLP, ReentrancyGuard {
using SafeMath for uint256;
uint256 public constant RATE_BASE = 1e18;
uint256 public constant WEIGHT_BASE = 100;
address public immutable cofiToken;
address public immutable factory;
uint256 public immutable genesisBlock;
/... | //
// Reward Pool Controller for Liquidity Provider | LineComment | getEnabledPoolCnt | function getEnabledPoolCnt() external override view returns (uint256) {
return enabledCnt;
}
| // pools in enabled state | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
8648,
8756
]
} | 551 | ||
UniV3LiquidityAMO_V2 | contracts/Frax/Pools/FraxPoolLibrary.sol | 0xc91bb4b0696e3b48c0c501b4ce8e7244fc363a79 | Solidity | FraxPoolLibrary | library FraxPoolLibrary {
using SafeMath for uint256;
// Constants for various precisions
uint256 private constant PRICE_PRECISION = 1e6;
// ================ Structs ================
// Needed to lower stack size
struct MintFF_Params {
uint256 fxs_price_usd;
uint256 col_price_... | calcMint1t1FRAX | function calcMint1t1FRAX(uint256 col_price, uint256 collateral_amount_d18) public pure returns (uint256) {
return (collateral_amount_d18.mul(col_price)).div(1e6);
}
| // ================ Functions ================ | LineComment | v0.8.6+commit.11564f7e | {
"func_code_index": [
654,
834
]
} | 552 | ||||
UniV3LiquidityAMO_V2 | contracts/Frax/Pools/FraxPoolLibrary.sol | 0xc91bb4b0696e3b48c0c501b4ce8e7244fc363a79 | Solidity | FraxPoolLibrary | library FraxPoolLibrary {
using SafeMath for uint256;
// Constants for various precisions
uint256 private constant PRICE_PRECISION = 1e6;
// ================ Structs ================
// Needed to lower stack size
struct MintFF_Params {
uint256 fxs_price_usd;
uint256 col_price_... | calcMintFractionalFRAX | function calcMintFractionalFRAX(MintFF_Params memory params) internal pure returns (uint256, uint256) {
// Since solidity truncates division, every division operation must be the last operation in the equation to ensure minimum error
// The contract must check the proper ratio was sent to mint FRAX. We do this ... | // Must be internal because of the struct | LineComment | v0.8.6+commit.11564f7e | {
"func_code_index": [
1064,
2249
]
} | 553 | ||||
UniV3LiquidityAMO_V2 | contracts/Frax/Pools/FraxPoolLibrary.sol | 0xc91bb4b0696e3b48c0c501b4ce8e7244fc363a79 | Solidity | FraxPoolLibrary | library FraxPoolLibrary {
using SafeMath for uint256;
// Constants for various precisions
uint256 private constant PRICE_PRECISION = 1e6;
// ================ Structs ================
// Needed to lower stack size
struct MintFF_Params {
uint256 fxs_price_usd;
uint256 col_price_... | calcBuyBackFXS | function calcBuyBackFXS(BuybackFXS_Params memory params) internal pure returns (uint256) {
// If the total collateral value is higher than the amount required at the current collateral ratio then buy back up to the possible FXS with the desired collateral
require(params.excess_collateral_dollar_value_d18 > 0, "... | // Must be internal because of the struct | LineComment | v0.8.6+commit.11564f7e | {
"func_code_index": [
2467,
3522
]
} | 554 | ||||
UniV3LiquidityAMO_V2 | contracts/Frax/Pools/FraxPoolLibrary.sol | 0xc91bb4b0696e3b48c0c501b4ce8e7244fc363a79 | Solidity | FraxPoolLibrary | library FraxPoolLibrary {
using SafeMath for uint256;
// Constants for various precisions
uint256 private constant PRICE_PRECISION = 1e6;
// ================ Structs ================
// Needed to lower stack size
struct MintFF_Params {
uint256 fxs_price_usd;
uint256 col_price_... | recollateralizeAmount | function recollateralizeAmount(uint256 total_supply, uint256 global_collateral_ratio, uint256 global_collat_value) public pure returns (uint256) {
uint256 target_collat_value = total_supply.mul(global_collateral_ratio).div(1e6); // We want 18 decimals of precision so divide by 1e6; total_supply is 1e18 and global_c... | // Returns value of collateral that must increase to reach recollateralization target (if 0 means no recollateralization) | LineComment | v0.8.6+commit.11564f7e | {
"func_code_index": [
3651,
4321
]
} | 555 | ||||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | PermissionGroups | contract PermissionGroups {
address public admin;
address public pendingAdmin;
mapping(address=>bool) internal operators;
mapping(address=>bool) internal alerters;
address[] internal operatorsGroup;
address[] internal alertersGroup;
function PermissionGroups() public {
ad... | transferAdmin | function transferAdmin(address newAdmin) public onlyAdmin {
require(newAdmin != address(0));
TransferAdminPending(pendingAdmin);
pendingAdmin = newAdmin;
}
| /**
* @dev Allows the current admin to set the pendingAdmin address.
* @param newAdmin The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
1038,
1230
]
} | 556 | |||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | PermissionGroups | contract PermissionGroups {
address public admin;
address public pendingAdmin;
mapping(address=>bool) internal operators;
mapping(address=>bool) internal alerters;
address[] internal operatorsGroup;
address[] internal alertersGroup;
function PermissionGroups() public {
ad... | claimAdmin | function claimAdmin() public {
require(pendingAdmin == msg.sender);
AdminClaimed(pendingAdmin, admin);
admin = pendingAdmin;
pendingAdmin = address(0);
}
| /**
* @dev Allows the pendingAdmin address to finalize the change admin process.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
1403,
1602
]
} | 557 | |||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | Withdrawable | contract Withdrawable is PermissionGroups {
event TokenWithdraw(ERC20 token, uint amount, address sendTo);
/**
* @dev Withdraw all ERC20 compatible tokens
* @param token ERC20 The address of the token contract
*/
function withdrawToken(ERC20 token, uint amount, address sendTo) exter... | withdrawToken | function withdrawToken(ERC20 token, uint amount, address sendTo) external onlyAdmin {
require(token.transfer(sendTo, amount));
TokenWithdraw(token, amount, sendTo);
}
| /**
* @dev Withdraw all ERC20 compatible tokens
* @param token ERC20 The address of the token contract
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
246,
440
]
} | 558 | |||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | Withdrawable | contract Withdrawable is PermissionGroups {
event TokenWithdraw(ERC20 token, uint amount, address sendTo);
/**
* @dev Withdraw all ERC20 compatible tokens
* @param token ERC20 The address of the token contract
*/
function withdrawToken(ERC20 token, uint amount, address sendTo) exter... | withdrawEther | function withdrawEther(uint amount, address sendTo) external onlyAdmin {
sendTo.transfer(amount);
EtherWithdraw(amount, sendTo);
}
| /**
* @dev Withdraw Ethers
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
547,
705
]
} | 559 | |||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | KyberNetwork | contract KyberNetwork is Withdrawable, Utils {
uint public negligibleRateDiff = 10; // basic rate steps will be in 0.01%
KyberReserveInterface[] public reserves;
mapping(address=>bool) public isReserve;
WhiteListInterface public whiteListContract;
ExpectedRateInterface public expectedRateCont... | function() public payable {
require(isReserve[msg.sender]);
EtherReceival(msg.sender, msg.value);
}
| /* solhint-disable no-complex-fallback */ | Comment | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
853,
980
]
} | 560 | ||||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | KyberNetwork | contract KyberNetwork is Withdrawable, Utils {
uint public negligibleRateDiff = 10; // basic rate steps will be in 0.01%
KyberReserveInterface[] public reserves;
mapping(address=>bool) public isReserve;
WhiteListInterface public whiteListContract;
ExpectedRateInterface public expectedRateCont... | trade | function trade(
ERC20 src,
uint srcAmount,
ERC20 dest,
address destAddress,
uint maxDestAmount,
uint minConversionRate,
address walletId
)
public
payable
returns(uint)
{
require(enabled);
uint userSrcBalanceBefore;
uint userSrcBalanceAfter;
uint ... | /// @notice use token address ETH_TOKEN_ADDRESS for ether
/// @dev makes a trade between src and dest token and send dest token to destAddress
/// @param src Src token
/// @param srcAmount amount of src tokens
/// @param dest Destination token
/// @param destAddress Address to send tokens to
/// @param maxDestAmount ... | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
1760,
3384
]
} | 561 | |||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | KyberNetwork | contract KyberNetwork is Withdrawable, Utils {
uint public negligibleRateDiff = 10; // basic rate steps will be in 0.01%
KyberReserveInterface[] public reserves;
mapping(address=>bool) public isReserve;
WhiteListInterface public whiteListContract;
ExpectedRateInterface public expectedRateCont... | addReserve | function addReserve(KyberReserveInterface reserve, bool add) public onlyAdmin {
if (add) {
require(!isReserve[reserve]);
reserves.push(reserve);
isReserve[reserve] = true;
AddReserveToNetwork(reserve, true);
} else {
isReserve[reserve] = false;
// will h... | /// @notice can be called only by admin
/// @dev add or deletes a reserve to/from the network.
/// @param reserve The reserve address.
/// @param add If true, the add reserve. Otherwise delete reserve. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
3684,
4430
]
} | 562 | |||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | KyberNetwork | contract KyberNetwork is Withdrawable, Utils {
uint public negligibleRateDiff = 10; // basic rate steps will be in 0.01%
KyberReserveInterface[] public reserves;
mapping(address=>bool) public isReserve;
WhiteListInterface public whiteListContract;
ExpectedRateInterface public expectedRateCont... | listPairForReserve | function listPairForReserve(address reserve, ERC20 src, ERC20 dest, bool add) public onlyAdmin {
(perReserveListedPairs[reserve])[keccak256(src, dest)] = add;
if (src != ETH_TOKEN_ADDRESS) {
if (add) {
src.approve(reserve, 2**255); // approve infinity
} else {
src... | /// @notice can be called only by admin
/// @dev allow or prevent a specific reserve to trade a pair of tokens
/// @param reserve The reserve address.
/// @param src Src token
/// @param dest Destination token
/// @param add If true then enable trade, otherwise delist pair. | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
4819,
5333
]
} | 563 | |||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | KyberNetwork | contract KyberNetwork is Withdrawable, Utils {
uint public negligibleRateDiff = 10; // basic rate steps will be in 0.01%
KyberReserveInterface[] public reserves;
mapping(address=>bool) public isReserve;
WhiteListInterface public whiteListContract;
ExpectedRateInterface public expectedRateCont... | getNumReserves | function getNumReserves() public view returns(uint) {
return reserves.length;
}
| /// @dev returns number of reserves
/// @return number of reserves | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
6373,
6471
]
} | 564 | |||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | KyberNetwork | contract KyberNetwork is Withdrawable, Utils {
uint public negligibleRateDiff = 10; // basic rate steps will be in 0.01%
KyberReserveInterface[] public reserves;
mapping(address=>bool) public isReserve;
WhiteListInterface public whiteListContract;
ExpectedRateInterface public expectedRateCont... | getReserves | function getReserves() public view returns(KyberReserveInterface[]) {
return reserves;
}
| /// @notice should be called off chain with as much gas as needed
/// @dev get an array of all reserves
/// @return An array of all reserves | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
6630,
6737
]
} | 565 | |||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | KyberNetwork | contract KyberNetwork is Withdrawable, Utils {
uint public negligibleRateDiff = 10; // basic rate steps will be in 0.01%
KyberReserveInterface[] public reserves;
mapping(address=>bool) public isReserve;
WhiteListInterface public whiteListContract;
ExpectedRateInterface public expectedRateCont... | getBalance | function getBalance(ERC20 token, address user) public view returns(uint) {
if (token == ETH_TOKEN_ADDRESS)
return user.balance;
else
return token.balanceOf(user);
}
| /// @dev get the balance of a user.
/// @param token The token type
/// @return The balance | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
6847,
7065
]
} | 566 | |||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | KyberNetwork | contract KyberNetwork is Withdrawable, Utils {
uint public negligibleRateDiff = 10; // basic rate steps will be in 0.01%
KyberReserveInterface[] public reserves;
mapping(address=>bool) public isReserve;
WhiteListInterface public whiteListContract;
ExpectedRateInterface public expectedRateCont... | findBestRate | function findBestRate(ERC20 src, ERC20 dest, uint srcQty) public view returns(uint, uint) {
uint bestRate = 0;
uint bestReserve = 0;
uint numRelevantReserves = 0;
uint numReserves = reserves.length;
uint[] memory rates = new uint[](numReserves);
uint[] memory reserveCandidates = new uint[]... | /* solhint-disable code-complexity */ | Comment | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
7356,
8922
]
} | 567 | |||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | KyberNetwork | contract KyberNetwork is Withdrawable, Utils {
uint public negligibleRateDiff = 10; // basic rate steps will be in 0.01%
KyberReserveInterface[] public reserves;
mapping(address=>bool) public isReserve;
WhiteListInterface public whiteListContract;
ExpectedRateInterface public expectedRateCont... | getExpectedRate | function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty)
public view
returns (uint expectedRate, uint slippageRate)
{
require(expectedRateContract != address(0));
return expectedRateContract.getExpectedRate(src, dest, srcQty);
}
| /* solhint-enable code-complexity */ | Comment | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
8967,
9250
]
} | 568 | |||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | KyberNetwork | contract KyberNetwork is Withdrawable, Utils {
uint public negligibleRateDiff = 10; // basic rate steps will be in 0.01%
KyberReserveInterface[] public reserves;
mapping(address=>bool) public isReserve;
WhiteListInterface public whiteListContract;
ExpectedRateInterface public expectedRateCont... | doReserveTrade | function doReserveTrade(
ERC20 src,
uint amount,
ERC20 dest,
address destAddress,
uint expectedDestAmount,
KyberReserveInterface reserve,
uint conversionRate,
bool validate
)
internal
returns(bool)
{
uint callValue = 0;
if (src == ETH_TOKEN_ADDRESS) {
... | /// @notice use token address ETH_TOKEN_ADDRESS for ether
/// @dev do one trade with a reserve
/// @param src Src token
/// @param amount amount of src tokens
/// @param dest Destination token
/// @param destAddress Address to send tokens to
/// @param reserve Reserve to use
/// @param validate If true, additional va... | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
11793,
12750
]
} | 569 | |||
KyberNetwork | KyberNetwork.sol | 0x5ee0e9a86f17a235ace5e116394aab940d0d2593 | Solidity | KyberNetwork | contract KyberNetwork is Withdrawable, Utils {
uint public negligibleRateDiff = 10; // basic rate steps will be in 0.01%
KyberReserveInterface[] public reserves;
mapping(address=>bool) public isReserve;
WhiteListInterface public whiteListContract;
ExpectedRateInterface public expectedRateCont... | validateTradeInput | function validateTradeInput(ERC20 src, uint srcAmount, address destAddress) internal view returns(bool) {
if ((srcAmount >= MAX_QTY) || (srcAmount == 0) || (destAddress == 0))
return false;
if (src == ETH_TOKEN_ADDRESS) {
if (msg.value != srcAmount)
return false;
} else {... | /// @notice use token address ETH_TOKEN_ADDRESS for ether
/// @dev checks that user sent ether/tokens to contract before trade
/// @param src Src token
/// @param srcAmount amount of src tokens
/// @return true if input is valid | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://559b09ac1c4824180efc175d11b2da3bc65e155de52aa4d8c52d4f85d292d154 | {
"func_code_index": [
13408,
13914
]
} | 570 | |||
BCCToken | BCCToken.sol | 0x782360813c4afc92d3c14af8c4c761d8cd5d46e5 | Solidity | BCCToken | contract BCCToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | BCCToken | function BCCToken() public {
symbol = "BCC";
name = "Black Chip Coin";
decimals = 3;
_totalSupply = 10000000000;
balances[0x6F063C824059559Cb67849F860f4f63208F30A08] = _totalSupply;
Transfer(address(0), 0x6F063C824059559Cb67849F860f4f63208F30A08, _totalSupply);
}
| // ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------ | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://04cca25256949485f592083e751e6113bdc31de17c2f173a6b61efc07765adf3 | {
"func_code_index": [
455,
782
]
} | 571 | |
BCCToken | BCCToken.sol | 0x782360813c4afc92d3c14af8c4c761d8cd5d46e5 | Solidity | BCCToken | contract BCCToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | totalSupply | function totalSupply() public constant returns (uint) {
return _totalSupply - balances[address(0)];
}
| // ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------ | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://04cca25256949485f592083e751e6113bdc31de17c2f173a6b61efc07765adf3 | {
"func_code_index": [
970,
1091
]
} | 572 | |
BCCToken | BCCToken.sol | 0x782360813c4afc92d3c14af8c4c761d8cd5d46e5 | Solidity | BCCToken | contract BCCToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | balanceOf | function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
| // ------------------------------------------------------------------------
// Get the token balance for account tokenOwner
// ------------------------------------------------------------------------ | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://04cca25256949485f592083e751e6113bdc31de17c2f173a6b61efc07765adf3 | {
"func_code_index": [
1311,
1440
]
} | 573 | |
BCCToken | BCCToken.sol | 0x782360813c4afc92d3c14af8c4c761d8cd5d46e5 | Solidity | BCCToken | contract BCCToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | transfer | function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
return true;
}
| // ------------------------------------------------------------------------
// Transfer the balance from token owner's account to to account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------ | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://04cca25256949485f592083e751e6113bdc31de17c2f173a6b61efc07765adf3 | {
"func_code_index": [
1784,
2061
]
} | 574 | |
BCCToken | BCCToken.sol | 0x782360813c4afc92d3c14af8c4c761d8cd5d46e5 | Solidity | BCCToken | contract BCCToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | approve | function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
| // ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double... | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://04cca25256949485f592083e751e6113bdc31de17c2f173a6b61efc07765adf3 | {
"func_code_index": [
2569,
2777
]
} | 575 | |
BCCToken | BCCToken.sol | 0x782360813c4afc92d3c14af8c4c761d8cd5d46e5 | Solidity | BCCToken | contract BCCToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | transferFrom | function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
return... | // ------------------------------------------------------------------------
// Transfer tokens from the from account to the to account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the from account and
// - From account must have sufficient balance to transfer
// - S... | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://04cca25256949485f592083e751e6113bdc31de17c2f173a6b61efc07765adf3 | {
"func_code_index": [
3308,
3666
]
} | 576 | |
BCCToken | BCCToken.sol | 0x782360813c4afc92d3c14af8c4c761d8cd5d46e5 | Solidity | BCCToken | contract BCCToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | allowance | function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
| // ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------ | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://04cca25256949485f592083e751e6113bdc31de17c2f173a6b61efc07765adf3 | {
"func_code_index": [
3949,
4105
]
} | 577 | |
BCCToken | BCCToken.sol | 0x782360813c4afc92d3c14af8c4c761d8cd5d46e5 | Solidity | BCCToken | contract BCCToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | approveAndCall | function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
| // ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account. The spender contract function
// receiveApproval(...) is then executed
// --------------------------------------------------------------------... | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://04cca25256949485f592083e751e6113bdc31de17c2f173a6b61efc07765adf3 | {
"func_code_index": [
4460,
4777
]
} | 578 | |
BCCToken | BCCToken.sol | 0x782360813c4afc92d3c14af8c4c761d8cd5d46e5 | Solidity | BCCToken | contract BCCToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | function () public payable {
revert();
}
| // ------------------------------------------------------------------------
// Don't accept ETH
// ------------------------------------------------------------------------ | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://04cca25256949485f592083e751e6113bdc31de17c2f173a6b61efc07765adf3 | {
"func_code_index": [
4969,
5028
]
} | 579 | ||
BCCToken | BCCToken.sol | 0x782360813c4afc92d3c14af8c4c761d8cd5d46e5 | Solidity | BCCToken | contract BCCToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | transferAnyERC20Token | function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
| // ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------ | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://04cca25256949485f592083e751e6113bdc31de17c2f173a6b61efc07765adf3 | {
"func_code_index": [
5261,
5450
]
} | 580 | |
FTCVesting | contracts/token/FTCVesting.sol | 0x5a2caf985d71a281662e0925738e54123da56c40 | Solidity | FTCVesting | contract FTCVesting {
using SafeMath for uint256;
address public index;
address public recipient;
address public treasury;
uint256 public vestingAmount;
uint256 public vestingBegin;
uint256 public vestingCliff;
uint256 public vestingEnd;
uint256 public lastUpdate;
constructor... | /// @title A vesting contract for full time contributors
/// @author 0xModene
/// @notice You can use this contract to set up vesting for full time DAO contributors
/// @dev All function calls are currently implemented without side effects | NatSpecSingleLine | setRecipient | function setRecipient(address recipient_) external onlyRecipient {
recipient = recipient_;
}
| /// @notice Sets new recipient address
/// @param recipient_ new recipient address | NatSpecSingleLine | v0.6.10+commit.00c0fcaf | {
"func_code_index": [
1485,
1593
]
} | 581 | ||
FTCVesting | contracts/token/FTCVesting.sol | 0x5a2caf985d71a281662e0925738e54123da56c40 | Solidity | FTCVesting | contract FTCVesting {
using SafeMath for uint256;
address public index;
address public recipient;
address public treasury;
uint256 public vestingAmount;
uint256 public vestingBegin;
uint256 public vestingCliff;
uint256 public vestingEnd;
uint256 public lastUpdate;
constructor... | /// @title A vesting contract for full time contributors
/// @author 0xModene
/// @notice You can use this contract to set up vesting for full time DAO contributors
/// @dev All function calls are currently implemented without side effects | NatSpecSingleLine | setTreasury | function setTreasury(address treasury_) external onlyTreasury {
treasury = treasury_;
}
| /// @notice Sets new treasury address
/// @param treasury_ new treasury address | NatSpecSingleLine | v0.6.10+commit.00c0fcaf | {
"func_code_index": [
1683,
1786
]
} | 582 | ||
FTCVesting | contracts/token/FTCVesting.sol | 0x5a2caf985d71a281662e0925738e54123da56c40 | Solidity | FTCVesting | contract FTCVesting {
using SafeMath for uint256;
address public index;
address public recipient;
address public treasury;
uint256 public vestingAmount;
uint256 public vestingBegin;
uint256 public vestingCliff;
uint256 public vestingEnd;
uint256 public lastUpdate;
constructor... | /// @title A vesting contract for full time contributors
/// @author 0xModene
/// @notice You can use this contract to set up vesting for full time DAO contributors
/// @dev All function calls are currently implemented without side effects | NatSpecSingleLine | claim | function claim() external onlyRecipient overCliff {
uint256 amount;
if (block.timestamp >= vestingEnd) {
amount = IERC20(index).balanceOf(address(this));
} else {
amount = vestingAmount.mul(block.timestamp.sub(lastUpdate)).div(vestingEnd.sub(vestingBegin));
lastUpdate = block.timesta... | /// @notice Allows recipient to claim all currently vested tokens | NatSpecSingleLine | v0.6.10+commit.00c0fcaf | {
"func_code_index": [
1858,
2276
]
} | 583 | ||
FTCVesting | contracts/token/FTCVesting.sol | 0x5a2caf985d71a281662e0925738e54123da56c40 | Solidity | FTCVesting | contract FTCVesting {
using SafeMath for uint256;
address public index;
address public recipient;
address public treasury;
uint256 public vestingAmount;
uint256 public vestingBegin;
uint256 public vestingCliff;
uint256 public vestingEnd;
uint256 public lastUpdate;
constructor... | /// @title A vesting contract for full time contributors
/// @author 0xModene
/// @notice You can use this contract to set up vesting for full time DAO contributors
/// @dev All function calls are currently implemented without side effects | NatSpecSingleLine | clawback | function clawback() external onlyTreasury {
IERC20(index).transfer(treasury, IERC20(index).balanceOf(address(this)));
}
| /// @notice Allows treasury to claw back funds in event of separation from recipient | NatSpecSingleLine | v0.6.10+commit.00c0fcaf | {
"func_code_index": [
2367,
2502
]
} | 584 | ||
CosmoArtPower | /Users/ivannikov/work/snake-jungle/4-cosmoarts/cosmoarts/contracts/contracts/CosmoArtPower.sol | 0x83a7cd977835d80502cb998e1216f01632f264de | Solidity | CosmoArtPower | contract CosmoArtPower is Ownable, CosmoArtPowerERC20 {
using SafeMath for uint256;
// Constants
uint256 public constant SECONDS_IN_A_DAY = 86400;
uint256 public constant INITIAL_ALLOTMENT = 183e18;
uint256 public constant PRE_REVEAL_MULTIPLIER = 2;
uint256 public constant emissionStart = 1627... | /**
* CosmoArtPower Contract (The native token of CosmoArt)
* https://thecosmoart.com/
* @dev Extends standard ERC20 contract
*/ | NatSpecMultiLine | lastClaim | function lastClaim(uint256 tokenIndex) public view returns (uint256) {
require(ICosmoArtShort(nftAddress).ownerOf(tokenIndex) != address(0), "CosmoArtPower: owner cannot be 0 address");
require(tokenIndex < ICosmoArtShort(nftAddress).totalSupply(), "CosmoArtPower: CosmoArt at index has not been minted yet");
... | /**
* @dev When accumulated CAPs have last been claimed for a CosmoMask index
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | {
"func_code_index": [
822,
1328
]
} | 585 | ||
CosmoArtPower | /Users/ivannikov/work/snake-jungle/4-cosmoarts/cosmoarts/contracts/contracts/CosmoArtPower.sol | 0x83a7cd977835d80502cb998e1216f01632f264de | Solidity | CosmoArtPower | contract CosmoArtPower is Ownable, CosmoArtPowerERC20 {
using SafeMath for uint256;
// Constants
uint256 public constant SECONDS_IN_A_DAY = 86400;
uint256 public constant INITIAL_ALLOTMENT = 183e18;
uint256 public constant PRE_REVEAL_MULTIPLIER = 2;
uint256 public constant emissionStart = 1627... | /**
* CosmoArtPower Contract (The native token of CosmoArt)
* https://thecosmoart.com/
* @dev Extends standard ERC20 contract
*/ | NatSpecMultiLine | accumulated | function accumulated(uint256 tokenIndex) public view returns (uint256) {
require(block.timestamp > emissionStart, "CosmoArtPower: emission has not started yet");
require(ICosmoArtShort(nftAddress).ownerOf(tokenIndex) != address(0), "CosmoArtPower: owner cannot be 0 address");
require(tokenIndex < ICosmoArtS... | /**
* @dev Accumulated CAP tokens for a CosmoMask token index.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | {
"func_code_index": [
1410,
2774
]
} | 586 | ||
CosmoArtPower | /Users/ivannikov/work/snake-jungle/4-cosmoarts/cosmoarts/contracts/contracts/CosmoArtPower.sol | 0x83a7cd977835d80502cb998e1216f01632f264de | Solidity | CosmoArtPower | contract CosmoArtPower is Ownable, CosmoArtPowerERC20 {
using SafeMath for uint256;
// Constants
uint256 public constant SECONDS_IN_A_DAY = 86400;
uint256 public constant INITIAL_ALLOTMENT = 183e18;
uint256 public constant PRE_REVEAL_MULTIPLIER = 2;
uint256 public constant emissionStart = 1627... | /**
* CosmoArtPower Contract (The native token of CosmoArt)
* https://thecosmoart.com/
* @dev Extends standard ERC20 contract
*/ | NatSpecMultiLine | setNftAddress | function setNftAddress(address _nftAddress) public onlyOwner {
require(nftAddress == address(0), "CosmoArt: NFT has already setted");
require(_nftAddress != address(0), "CosmoArt: new NFT is the zero address");
nftAddress = _nftAddress;
}
| /**
* @dev Permissioning not added because it is only callable once. It is set right after deployment and verified.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | {
"func_code_index": [
2909,
3179
]
} | 587 | ||
CosmoArtPower | /Users/ivannikov/work/snake-jungle/4-cosmoarts/cosmoarts/contracts/contracts/CosmoArtPower.sol | 0x83a7cd977835d80502cb998e1216f01632f264de | Solidity | CosmoArtPower | contract CosmoArtPower is Ownable, CosmoArtPowerERC20 {
using SafeMath for uint256;
// Constants
uint256 public constant SECONDS_IN_A_DAY = 86400;
uint256 public constant INITIAL_ALLOTMENT = 183e18;
uint256 public constant PRE_REVEAL_MULTIPLIER = 2;
uint256 public constant emissionStart = 1627... | /**
* CosmoArtPower Contract (The native token of CosmoArt)
* https://thecosmoart.com/
* @dev Extends standard ERC20 contract
*/ | NatSpecMultiLine | claim | function claim(uint256[] memory tokenIndices) public returns (uint256) {
require(block.timestamp > emissionStart, "CosmoArtPower: Emission has not started yet");
uint256 totalClaimQty = 0;
for (uint256 i = 0; i < tokenIndices.length; i++) {
// Sanity check for non-minted index
require(token... | /**
* @dev Claim mints CAPs and supports multiple CosmoMask token indices at once.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | {
"func_code_index": [
3281,
4516
]
} | 588 | ||
TRF_Token | TRF_Token.sol | 0x17366bf0bfd8db99b372c5d4d6841dfd9f8db084 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) pub... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | transfer | function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
... | /**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | MIT | bzzr://511256506049a0448127121cee178b1f8903c212ce95ba0a94cf22b53c0dfb1e | {
"func_code_index": [
268,
664
]
} | 589 |
TRF_Token | TRF_Token.sol | 0x17366bf0bfd8db99b372c5d4d6841dfd9f8db084 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) pub... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
| /**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | MIT | bzzr://511256506049a0448127121cee178b1f8903c212ce95ba0a94cf22b53c0dfb1e | {
"func_code_index": [
879,
998
]
} | 590 |
TRF_Token | TRF_Token.sol | 0x17366bf0bfd8db99b372c5d4d6841dfd9f8db084 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[... | /**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | MIT | bzzr://511256506049a0448127121cee178b1f8903c212ce95ba0a94cf22b53c0dfb1e | {
"func_code_index": [
399,
856
]
} | 591 |
TRF_Token | TRF_Token.sol | 0x17366bf0bfd8db99b372c5d4d6841dfd9f8db084 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | approve | function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
| /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this ... | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | MIT | bzzr://511256506049a0448127121cee178b1f8903c212ce95ba0a94cf22b53c0dfb1e | {
"func_code_index": [
1488,
1682
]
} | 592 |
TRF_Token | TRF_Token.sol | 0x17366bf0bfd8db99b372c5d4d6841dfd9f8db084 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | allowance | function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
| /**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | MIT | bzzr://511256506049a0448127121cee178b1f8903c212ce95ba0a94cf22b53c0dfb1e | {
"func_code_index": [
2006,
2154
]
} | 593 |
TRF_Token | TRF_Token.sol | 0x17366bf0bfd8db99b372c5d4d6841dfd9f8db084 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | increaseApproval | function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| /**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined) * From MonolithDAO Token.sol
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | MIT | bzzr://511256506049a0448127121cee178b1f8903c212ce95ba0a94cf22b53c0dfb1e | {
"func_code_index": [
2395,
2670
]
} | 594 |
TRF_Token | TRF_Token.sol | 0x17366bf0bfd8db99b372c5d4d6841dfd9f8db084 | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | Ownable | function Ownable() public {
owner = msg.sender;
}
| /**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | MIT | bzzr://511256506049a0448127121cee178b1f8903c212ce95ba0a94cf22b53c0dfb1e | {
"func_code_index": [
261,
321
]
} | 595 |
TRF_Token | TRF_Token.sol | 0x17366bf0bfd8db99b372c5d4d6841dfd9f8db084 | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
| /**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | MIT | bzzr://511256506049a0448127121cee178b1f8903c212ce95ba0a94cf22b53c0dfb1e | {
"func_code_index": [
644,
820
]
} | 596 |
TRF_Token | TRF_Token.sol | 0x17366bf0bfd8db99b372c5d4d6841dfd9f8db084 | Solidity | MintableToken | contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
address public saleAgent;
function setSaleAgent(address newSaleAgnet) public {
require(msg.sender == saleAgent || msg.sender =... | /**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/ | NatSpecMultiLine | finishMinting | function finishMinting() public returns (bool) {
require((msg.sender == saleAgent || msg.sender == owner) && !mintingFinished);
mintingFinished = true;
MintFinished();
return true;
}
| /**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | MIT | bzzr://511256506049a0448127121cee178b1f8903c212ce95ba0a94cf22b53c0dfb1e | {
"func_code_index": [
757,
965
]
} | 597 |
FinallyCoinConnects | FinallyCoinConnects.sol | 0x293893ed96ae04dc93323f8ac695e6110ee4901a | Solidity | FinallyCoinConnects | contract FinallyCoinConnects {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18; //小数位
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
... | FinallyCoinConnects | function FinallyCoinConnects (
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial token... | /**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | None | bzzr://95f71c2409cd6186f85a69a6fb50ab8a92dce6d4f891b199bb7f74ca161bd5c1 | {
"func_code_index": [
856,
1411
]
} | 598 | ||
FinallyCoinConnects | FinallyCoinConnects.sol | 0x293893ed96ae04dc93323f8ac695e6110ee4901a | Solidity | FinallyCoinConnects | contract FinallyCoinConnects {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18; //小数位
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
... | _transfer | function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to])... | /**
* Internal transfer, only can be called by this contract
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | None | bzzr://95f71c2409cd6186f85a69a6fb50ab8a92dce6d4f891b199bb7f74ca161bd5c1 | {
"func_code_index": [
1495,
2337
]
} | 599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.