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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | ERC20 | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | _approve | function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(ow... | /**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero a... | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
8326,
8712
]
} | 23,500 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | ERC20 | contract ERC20 is Context, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
... | _beforeTokenTransfer | function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
| /**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* -... | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
9311,
9441
]
} | 23,501 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| /**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
259,
446
]
} | 23,502 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
| /**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
725,
866
]
} | 23,503 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | sub | function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
| /**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
1165,
1363
]
} | 23,504 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
... | /**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
1618,
2096
]
} | 23,505 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
| /**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to reve... | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
2568,
2705
]
} | 23,506 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | div | function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
| /**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an in... | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
3197,
3481
]
} | 23,507 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | mod | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consumi... | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
3942,
4077
]
} | 23,508 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | mod | function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcod... | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
4558,
4729
]
} | 23,509 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
... | owner | function owner() public view returns (address) {
return _owner;
}
| /**
* @dev Returns the address of the current owner.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
491,
575
]
} | 23,510 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
... | renounceOwnership | function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
| /**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
1135,
1288
]
} | 23,511 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
... | transferOwnership | function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
| /**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
1439,
1688
]
} | 23,512 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | SafeMathInt | library SafeMathInt {
int256 private constant MIN_INT256 = int256(1) << 255;
int256 private constant MAX_INT256 = ~(int256(1) << 255);
/**
* @dev Multiplies two int256 variables and fails on overflow.
*/
function mul(int256 a, int256 b) internal pure returns (int256) {
int256... | mul | function mul(int256 a, int256 b) internal pure returns (int256) {
int256 c = a * b;
// Detect overflow when multiplying MIN_INT256 with -1
require(c != MIN_INT256 || (a & MIN_INT256) != (b & MIN_INT256));
require((b == 0) || (c / b == a));
return c;
}
| /**
* @dev Multiplies two int256 variables and fails on overflow.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
235,
544
]
} | 23,513 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | SafeMathInt | library SafeMathInt {
int256 private constant MIN_INT256 = int256(1) << 255;
int256 private constant MAX_INT256 = ~(int256(1) << 255);
/**
* @dev Multiplies two int256 variables and fails on overflow.
*/
function mul(int256 a, int256 b) internal pure returns (int256) {
int256... | div | function div(int256 a, int256 b) internal pure returns (int256) {
// Prevent overflow when dividing MIN_INT256 by -1
require(b != -1 || a != MIN_INT256);
// Solidity already throws when dividing by 0.
return a / b;
}
| /**
* @dev Division of two int256 variables and fails on overflow.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
635,
900
]
} | 23,514 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | SafeMathInt | library SafeMathInt {
int256 private constant MIN_INT256 = int256(1) << 255;
int256 private constant MAX_INT256 = ~(int256(1) << 255);
/**
* @dev Multiplies two int256 variables and fails on overflow.
*/
function mul(int256 a, int256 b) internal pure returns (int256) {
int256... | sub | function sub(int256 a, int256 b) internal pure returns (int256) {
int256 c = a - b;
require((b >= 0 && c <= a) || (b < 0 && c > a));
return c;
}
| /**
* @dev Subtracts two int256 variables and fails on overflow.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
989,
1170
]
} | 23,515 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | SafeMathInt | library SafeMathInt {
int256 private constant MIN_INT256 = int256(1) << 255;
int256 private constant MAX_INT256 = ~(int256(1) << 255);
/**
* @dev Multiplies two int256 variables and fails on overflow.
*/
function mul(int256 a, int256 b) internal pure returns (int256) {
int256... | add | function add(int256 a, int256 b) internal pure returns (int256) {
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a));
return c;
}
| /**
* @dev Adds two int256 variables and fails on overflow.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
1254,
1435
]
} | 23,516 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | SafeMathInt | library SafeMathInt {
int256 private constant MIN_INT256 = int256(1) << 255;
int256 private constant MAX_INT256 = ~(int256(1) << 255);
/**
* @dev Multiplies two int256 variables and fails on overflow.
*/
function mul(int256 a, int256 b) internal pure returns (int256) {
int256... | abs | function abs(int256 a) internal pure returns (int256) {
require(a != MIN_INT256);
return a < 0 ? -a : a;
}
| /**
* @dev Converts to absolute value, and fails on overflow.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
1521,
1655
]
} | 23,517 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | DOGEJO | contract DOGEJO is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool private swapping;
address public marketingWallet;
address public devWallet;
uint256 public maxTransactionAmount... | enableTrading | function enableTrading() external onlyOwner {
tradingActive = true;
swapEnabled = true;
launchedAt = block.number;
}
| // once enabled, can never be turned off | LineComment | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
5163,
5316
]
} | 23,518 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | DOGEJO | contract DOGEJO is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool private swapping;
address public marketingWallet;
address public devWallet;
uint256 public maxTransactionAmount... | removeLimits | function removeLimits() external onlyOwner returns (bool){
limitsInEffect = false;
return true;
}
| // remove limits after token is stable | LineComment | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
5364,
5489
]
} | 23,519 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | DOGEJO | contract DOGEJO is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool private swapping;
address public marketingWallet;
address public devWallet;
uint256 public maxTransactionAmount... | disableTransferDelay | function disableTransferDelay() external onlyOwner returns (bool){
transferDelayEnabled = false;
return true;
}
| // disable Transfer delay - cannot be reenabled | LineComment | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
5546,
5685
]
} | 23,520 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | DOGEJO | contract DOGEJO is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool private swapping;
address public marketingWallet;
address public devWallet;
uint256 public maxTransactionAmount... | updateSwapTokensAtAmount | function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool){
require(newAmount >= totalSupply() * 1 / 100000, "Swap amount cannot be lower than 0.001% total supply.");
require(newAmount <= totalSupply() * 5 / 1000, "Swap amount cannot be higher than 0.5% total supply.");
swapTo... | // change the minimum amount of tokens to sell from fees | LineComment | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
5863,
6254
]
} | 23,521 | ||
DOGEJO | DOGEJO.sol | 0xb9d08264144217ad4765bed6f9bf4d6e2f47ee31 | Solidity | DOGEJO | contract DOGEJO is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool private swapping;
address public marketingWallet;
address public devWallet;
uint256 public maxTransactionAmount... | updateSwapEnabled | function updateSwapEnabled(bool enabled) external onlyOwner(){
swapEnabled = enabled;
}
| // only use to disable contract sales if absolutely necessary (emergency use only) | LineComment | v0.8.9+commit.e5eed63a | MIT | ipfs://732b2e15c6eec723733b338bf23c48bd9dc4a2e6181f19bd989b76b8e934ff10 | {
"func_code_index": [
6966,
7072
]
} | 23,522 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | ComptrollerInterface | contract ComptrollerInterface {
/// @notice Indicator that this is a Comptroller contract (for inspection)
bool public constant isComptroller = true;
/*** Assets You Are In ***/
function enterMarkets(address[] calldata cTokens) external returns (uint[] memory);
function exitMarket(address cToken) ... | enterMarkets | function enterMarkets(address[] calldata cTokens) external returns (uint[] memory);
| /*** Assets You Are In ***/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
192,
279
]
} | 23,523 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | ComptrollerInterface | contract ComptrollerInterface {
/// @notice Indicator that this is a Comptroller contract (for inspection)
bool public constant isComptroller = true;
/*** Assets You Are In ***/
function enterMarkets(address[] calldata cTokens) external returns (uint[] memory);
function exitMarket(address cToken) ... | mintAllowed | function mintAllowed(address cToken, address minter, uint mintAmount) external returns (uint);
| /*** Policy Hooks ***/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
374,
472
]
} | 23,524 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | ComptrollerInterface | contract ComptrollerInterface {
/// @notice Indicator that this is a Comptroller contract (for inspection)
bool public constant isComptroller = true;
/*** Assets You Are In ***/
function enterMarkets(address[] calldata cTokens) external returns (uint[] memory);
function exitMarket(address cToken) ... | liquidateCalculateSeizeTokens | function liquidateCalculateSeizeTokens(
address cTokenBorrowed,
address cTokenCollateral,
uint repayAmount) external view returns (uint, uint);
| /*** Liquidity/Liquidation Calculations ***/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
2387,
2558
]
} | 23,525 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | InterestRateModel | contract InterestRateModel {
/// @notice Indicator that this is an InterestRateModel contract (for inspection)
bool public constant isInterestRateModel = true;
/**
* @notice Calculates the current borrow interest rate per block
* @param cash The total amount of cash the market has
* @para... | /**
* @title Gama's InterestRateModel Interface
* @author gama
*/ | NatSpecMultiLine | getBorrowRate | function getBorrowRate(uint cash, uint borrows, uint reserves) external view returns (uint);
| /**
* @notice Calculates the current borrow interest rate per block
* @param cash The total amount of cash the market has
* @param borrows The total amount of borrows the market has outstanding
* @param reserves The total amnount of reserves the market has
* @return The borrow rate per block (as a percentage, and ... | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
543,
639
]
} | 23,526 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | InterestRateModel | contract InterestRateModel {
/// @notice Indicator that this is an InterestRateModel contract (for inspection)
bool public constant isInterestRateModel = true;
/**
* @notice Calculates the current borrow interest rate per block
* @param cash The total amount of cash the market has
* @para... | /**
* @title Gama's InterestRateModel Interface
* @author gama
*/ | NatSpecMultiLine | getSupplyRate | function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) external view returns (uint);
| /**
* @notice Calculates the current supply interest rate per block
* @param cash The total amount of cash the market has
* @param borrows The total amount of borrows the market has outstanding
* @param reserves The total amnount of reserves the market has
* @param reserveFactorMantissa The current reserve factor ... | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1094,
1218
]
} | 23,527 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GTokenInterface | contract GTokenInterface is GTokenStorage {
/**
* @notice Indicator that this is a GToken contract (for inspection)
*/
bool public constant isCToken = true;
/*** Market Events ***/
/**
* @notice Event emitted when interest is accrued
*/
event AccrueInterest(uint cashPrior, uin... | transfer | function transfer(address dst, uint amount) external returns (bool);
| /*** User Interface ***/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
2814,
2886
]
} | 23,528 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GTokenInterface | contract GTokenInterface is GTokenStorage {
/**
* @notice Indicator that this is a GToken contract (for inspection)
*/
bool public constant isCToken = true;
/*** Market Events ***/
/**
* @notice Event emitted when interest is accrued
*/
event AccrueInterest(uint cashPrior, uin... | _setPendingAdmin | function _setPendingAdmin(address payable newPendingAdmin) external returns (uint);
| /*** Admin Functions ***/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
4077,
4164
]
} | 23,529 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | CErc20Interface | contract CErc20Interface is CErc20Storage {
/*** User Interface ***/
function mint(uint mintAmount) external returns (uint);
function redeem(uint redeemTokens) external returns (uint);
function redeemUnderlying(uint redeemAmount) external returns (uint);
function borrow(uint borrowAmount) external... | mint | function mint(uint mintAmount) external returns (uint);
| /*** User Interface ***/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
75,
134
]
} | 23,530 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | CErc20Interface | contract CErc20Interface is CErc20Storage {
/*** User Interface ***/
function mint(uint mintAmount) external returns (uint);
function redeem(uint redeemTokens) external returns (uint);
function redeemUnderlying(uint redeemAmount) external returns (uint);
function borrow(uint borrowAmount) external... | _addReserves | function _addReserves(uint addAmount) external returns (uint);
| /*** Admin Functions ***/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
654,
720
]
} | 23,531 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | CDelegatorInterface | contract CDelegatorInterface is CDelegationStorage {
/**
* @notice Emitted when implementation is changed
*/
event NewImplementation(address oldImplementation, address newImplementation);
/**
* @notice Called by the admin to update the implementation of the delegator
* @param implementa... | _setImplementation | function _setImplementation(address implementation_, bool allowResign, bytes memory becomeImplementationData) public;
| /**
* @notice Called by the admin to update the implementation of the delegator
* @param implementation_ The address of the new implementation for delegation
* @param allowResign Flag to indicate whether to call _resignImplementation on the old implementation
* @param becomeImplementationData The encoded bytes data... | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
594,
715
]
} | 23,532 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | CDelegateInterface | contract CDelegateInterface is CDelegationStorage {
/**
* @notice Called by the delegator on a delegate to initialize it for duty
* @dev Should revert if any issues arise which make it unfit for delegation
* @param data The encoded bytes data for any initialization
*/
function _becomeImpleme... | _becomeImplementation | function _becomeImplementation(bytes memory data) public;
| /**
* @notice Called by the delegator on a delegate to initialize it for duty
* @dev Should revert if any issues arise which make it unfit for delegation
* @param data The encoded bytes data for any initialization
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
293,
354
]
} | 23,533 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | CDelegateInterface | contract CDelegateInterface is CDelegationStorage {
/**
* @notice Called by the delegator on a delegate to initialize it for duty
* @dev Should revert if any issues arise which make it unfit for delegation
* @param data The encoded bytes data for any initialization
*/
function _becomeImpleme... | _resignImplementation | function _resignImplementation() public;
| /**
* @notice Called by the delegator on a delegate to forfeit its responsibility
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
455,
499
]
} | 23,534 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | ComptrollerErrorReporter | contract ComptrollerErrorReporter {
enum Error {
NO_ERROR,
UNAUTHORIZED,
COMPTROLLER_MISMATCH,
INSUFFICIENT_SHORTFALL,
INSUFFICIENT_LIQUIDITY,
INVALID_CLOSE_FACTOR,
INVALID_COLLATERAL_FACTOR,
INVALID_LIQUIDATION_INCENTIVE,
MARKET_NOT_ENTERED, /... | fail | function fail(Error err, FailureInfo info) internal returns (uint) {
emit Failure(uint(err), uint(info), 0);
return uint(err);
}
| /**
* @dev use this when reporting a known error from the money market or a non-upgradeable collaborator
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1825,
1978
]
} | 23,535 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | ComptrollerErrorReporter | contract ComptrollerErrorReporter {
enum Error {
NO_ERROR,
UNAUTHORIZED,
COMPTROLLER_MISMATCH,
INSUFFICIENT_SHORTFALL,
INSUFFICIENT_LIQUIDITY,
INVALID_CLOSE_FACTOR,
INVALID_COLLATERAL_FACTOR,
INVALID_LIQUIDATION_INCENTIVE,
MARKET_NOT_ENTERED, /... | failOpaque | function failOpaque(Error err, FailureInfo info, uint opaqueError) internal returns (uint) {
emit Failure(uint(err), uint(info), opaqueError);
return uint(err);
}
| /**
* @dev use this when reporting an opaque error from an upgradeable collaborator contract
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
2092,
2279
]
} | 23,536 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | TokenErrorReporter | contract TokenErrorReporter {
enum Error {
NO_ERROR,
UNAUTHORIZED,
BAD_INPUT,
COMPTROLLER_REJECTION,
COMPTROLLER_CALCULATION_ERROR,
INTEREST_RATE_MODEL_ERROR,
INVALID_ACCOUNT_PAIR,
INVALID_CLOSE_AMOUNT_REQUESTED,
INVALID_COLLATERAL_FACTOR,
... | fail | function fail(Error err, FailureInfo info) internal returns (uint) {
emit Failure(uint(err), uint(info), 0);
return uint(err);
}
| /**
* @dev use this when reporting a known error from the money market or a non-upgradeable collaborator
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
4920,
5073
]
} | 23,537 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | TokenErrorReporter | contract TokenErrorReporter {
enum Error {
NO_ERROR,
UNAUTHORIZED,
BAD_INPUT,
COMPTROLLER_REJECTION,
COMPTROLLER_CALCULATION_ERROR,
INTEREST_RATE_MODEL_ERROR,
INVALID_ACCOUNT_PAIR,
INVALID_CLOSE_AMOUNT_REQUESTED,
INVALID_COLLATERAL_FACTOR,
... | failOpaque | function failOpaque(Error err, FailureInfo info, uint opaqueError) internal returns (uint) {
emit Failure(uint(err), uint(info), opaqueError);
return uint(err);
}
| /**
* @dev use this when reporting an opaque error from an upgradeable collaborator contract
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
5187,
5374
]
} | 23,538 | ||||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | CarefulMath | contract CarefulMath {
/**
* @dev Possible error codes that we can return
*/
enum MathError {
NO_ERROR,
DIVISION_BY_ZERO,
INTEGER_OVERFLOW,
INTEGER_UNDERFLOW
}
/**
* @dev Multiplies two numbers, returns an error on overflow.
*/
function mulUInt(uin... | /**
* @title Careful Math
* @author gama
* @notice Derived from OpenZeppelin's SafeMath library
* https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/ | NatSpecMultiLine | mulUInt | function mulUInt(uint a, uint b) internal pure returns (MathError, uint) {
if (a == 0) {
return (MathError.NO_ERROR, 0);
}
uint c = a * b;
if (c / a != b) {
return (MathError.INTEGER_OVERFLOW, 0);
} else {
return (MathError.NO_ERROR, c);
}
}
| /**
* @dev Multiplies two numbers, returns an error on overflow.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
296,
631
]
} | 23,539 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | CarefulMath | contract CarefulMath {
/**
* @dev Possible error codes that we can return
*/
enum MathError {
NO_ERROR,
DIVISION_BY_ZERO,
INTEGER_OVERFLOW,
INTEGER_UNDERFLOW
}
/**
* @dev Multiplies two numbers, returns an error on overflow.
*/
function mulUInt(uin... | /**
* @title Careful Math
* @author gama
* @notice Derived from OpenZeppelin's SafeMath library
* https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/ | NatSpecMultiLine | divUInt | function divUInt(uint a, uint b) internal pure returns (MathError, uint) {
if (b == 0) {
return (MathError.DIVISION_BY_ZERO, 0);
}
return (MathError.NO_ERROR, a / b);
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
717,
930
]
} | 23,540 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | CarefulMath | contract CarefulMath {
/**
* @dev Possible error codes that we can return
*/
enum MathError {
NO_ERROR,
DIVISION_BY_ZERO,
INTEGER_OVERFLOW,
INTEGER_UNDERFLOW
}
/**
* @dev Multiplies two numbers, returns an error on overflow.
*/
function mulUInt(uin... | /**
* @title Careful Math
* @author gama
* @notice Derived from OpenZeppelin's SafeMath library
* https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/ | NatSpecMultiLine | subUInt | function subUInt(uint a, uint b) internal pure returns (MathError, uint) {
if (b <= a) {
return (MathError.NO_ERROR, a - b);
} else {
return (MathError.INTEGER_UNDERFLOW, 0);
}
}
| /**
* @dev Subtracts two numbers, returns an error on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1056,
1290
]
} | 23,541 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | CarefulMath | contract CarefulMath {
/**
* @dev Possible error codes that we can return
*/
enum MathError {
NO_ERROR,
DIVISION_BY_ZERO,
INTEGER_OVERFLOW,
INTEGER_UNDERFLOW
}
/**
* @dev Multiplies two numbers, returns an error on overflow.
*/
function mulUInt(uin... | /**
* @title Careful Math
* @author gama
* @notice Derived from OpenZeppelin's SafeMath library
* https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/ | NatSpecMultiLine | addUInt | function addUInt(uint a, uint b) internal pure returns (MathError, uint) {
uint c = a + b;
if (c >= a) {
return (MathError.NO_ERROR, c);
} else {
return (MathError.INTEGER_OVERFLOW, 0);
}
}
| /**
* @dev Adds two numbers, returns an error on overflow.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1366,
1620
]
} | 23,542 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | CarefulMath | contract CarefulMath {
/**
* @dev Possible error codes that we can return
*/
enum MathError {
NO_ERROR,
DIVISION_BY_ZERO,
INTEGER_OVERFLOW,
INTEGER_UNDERFLOW
}
/**
* @dev Multiplies two numbers, returns an error on overflow.
*/
function mulUInt(uin... | /**
* @title Careful Math
* @author gama
* @notice Derived from OpenZeppelin's SafeMath library
* https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/ | NatSpecMultiLine | addThenSubUInt | function addThenSubUInt(uint a, uint b, uint c) internal pure returns (MathError, uint) {
(MathError err0, uint sum) = addUInt(a, b);
if (err0 != MathError.NO_ERROR) {
return (err0, 0);
}
return subUInt(sum, c);
}
| /**
* @dev add a and b and then subtract c
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1680,
1947
]
} | 23,543 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | getExp | function getExp(uint num, uint denom) pure internal returns (MathError, Exp memory) {
(MathError err0, uint scaledNumerator) = mulUInt(num, expScale);
if (err0 != MathError.NO_ERROR) {
return (err0, Exp({mantissa: 0}));
}
(MathError err1, uint rational) = divUInt(scaledNumerator, denom);
if... | /**
* @dev Creates an exponential from numerator and denominator values.
* Note: Returns an error if (`num` * 10e18) > MAX_INT,
* or if `denom` is zero.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
492,
999
]
} | 23,544 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | addExp | function addExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {
(MathError error, uint result) = addUInt(a.mantissa, b.mantissa);
return (error, Exp({mantissa: result}));
}
| /**
* @dev Adds two exponentials, returning a new exponential.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1081,
1306
]
} | 23,545 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | subExp | function subExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {
(MathError error, uint result) = subUInt(a.mantissa, b.mantissa);
return (error, Exp({mantissa: result}));
}
| /**
* @dev Subtracts two exponentials, returning a new exponential.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1393,
1618
]
} | 23,546 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | mulScalar | function mulScalar(Exp memory a, uint scalar) pure internal returns (MathError, Exp memory) {
(MathError err0, uint scaledMantissa) = mulUInt(a.mantissa, scalar);
if (err0 != MathError.NO_ERROR) {
return (err0, Exp({mantissa: 0}));
}
return (MathError.NO_ERROR, Exp({mantissa: scaledMantissa}));... | /**
* @dev Multiply an Exp by a scalar, returning a new Exp.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1698,
2048
]
} | 23,547 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | mulScalarTruncate | function mulScalarTruncate(Exp memory a, uint scalar) pure internal returns (MathError, uint) {
(MathError err, Exp memory product) = mulScalar(a, scalar);
if (err != MathError.NO_ERROR) {
return (err, 0);
}
return (MathError.NO_ERROR, truncate(product));
}
| /**
* @dev Multiply an Exp by a scalar, then truncate to return an unsigned integer.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
2152,
2462
]
} | 23,548 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | mulScalarTruncateAddUInt | function mulScalarTruncateAddUInt(Exp memory a, uint scalar, uint addend) pure internal returns (MathError, uint) {
(MathError err, Exp memory product) = mulScalar(a, scalar);
if (err != MathError.NO_ERROR) {
return (err, 0);
}
return addUInt(truncate(product), addend);
}
| /**
* @dev Multiply an Exp by a scalar, truncate, then add an to an unsigned integer, returning an unsigned integer.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
2598,
2923
]
} | 23,549 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | divScalar | function divScalar(Exp memory a, uint scalar) pure internal returns (MathError, Exp memory) {
(MathError err0, uint descaledMantissa) = divUInt(a.mantissa, scalar);
if (err0 != MathError.NO_ERROR) {
return (err0, Exp({mantissa: 0}));
}
return (MathError.NO_ERROR, Exp({mantissa: descaledMantissa... | /**
* @dev Divide an Exp by a scalar, returning a new Exp.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
3001,
3355
]
} | 23,550 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | divScalarByExp | function divScalarByExp(uint scalar, Exp memory divisor) pure internal returns (MathError, Exp memory) {
/*
We are doing this as:
getExp(mulUInt(expScale, scalar), divisor.mantissa)
How it works:
Exp = a / b;
Scalar = s;
`s / (a / b)` = `b * s / a` and since for an Exp `a = mant... | /**
* @dev Divide a scalar by an Exp, returning a new Exp.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
3433,
4042
]
} | 23,551 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | divScalarByExpTruncate | function divScalarByExpTruncate(uint scalar, Exp memory divisor) pure internal returns (MathError, uint) {
(MathError err, Exp memory fraction) = divScalarByExp(scalar, divisor);
if (err != MathError.NO_ERROR) {
return (err, 0);
}
return (MathError.NO_ERROR, truncate(fraction));
}
| /**
* @dev Divide a scalar by an Exp, then truncate to return an unsigned integer.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
4144,
4478
]
} | 23,552 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | mulExp | function mulExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {
(MathError err0, uint doubleScaledProduct) = mulUInt(a.mantissa, b.mantissa);
if (err0 != MathError.NO_ERROR) {
return (err0, Exp({mantissa: 0}));
}
// We add half the scale before dividing so that we g... | /**
* @dev Multiplies two exponentials, returning a new exponential.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
4566,
5686
]
} | 23,553 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | mulExp | function mulExp(uint a, uint b) pure internal returns (MathError, Exp memory) {
return mulExp(Exp({mantissa: a}), Exp({mantissa: b}));
}
| /**
* @dev Multiplies two exponentials given their mantissas, returning a new exponential.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
5796,
5948
]
} | 23,554 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | mulExp3 | function mulExp3(Exp memory a, Exp memory b, Exp memory c) pure internal returns (MathError, Exp memory) {
(MathError err, Exp memory ab) = mulExp(a, b);
if (err != MathError.NO_ERROR) {
return (err, ab);
}
return mulExp(ab, c);
}
| /**
* @dev Multiplies three exponentials, returning a new exponential.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
6038,
6320
]
} | 23,555 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | divExp | function divExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {
return getExp(a.mantissa, b.mantissa);
}
| /**
* @dev Divides two exponentials, returning a new exponential.
* (a/scale) / (b/scale) = (a/scale) * (scale/b) = a/b,
* which we can scale as an Exp by calling getExp(a.mantissa, b.mantissa)
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
6548,
6696
]
} | 23,556 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | truncate | function truncate(Exp memory exp) pure internal returns (uint) {
// Note: We are not using careful math here as we're performing a division that cannot fail
return exp.mantissa / expScale;
}
| /**
* @dev Truncates the given exp to a whole number value.
* For example, truncate(Exp{mantissa: 15 * expScale}) = 15
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
6844,
7058
]
} | 23,557 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | lessThanExp | function lessThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {
return left.mantissa < right.mantissa;
}
| /**
* @dev Checks if first Exp is less than second Exp.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
7133,
7276
]
} | 23,558 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | lessThanOrEqualExp | function lessThanOrEqualExp(Exp memory left, Exp memory right) pure internal returns (bool) {
return left.mantissa <= right.mantissa;
}
| /**
* @dev Checks if left Exp <= right Exp.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
7339,
7490
]
} | 23,559 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | greaterThanExp | function greaterThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {
return left.mantissa > right.mantissa;
}
| /**
* @dev Checks if left Exp > right Exp.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
7552,
7698
]
} | 23,560 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | Exponential | contract Exponential is CarefulMath {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Crea... | /**
* @title Exponential module for storing fixed-precision decimals
* @author Compound
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.... | NatSpecMultiLine | isZeroExp | function isZeroExp(Exp memory value) pure internal returns (bool) {
return value.mantissa == 0;
}
| /**
* @dev returns true if Exp is exactly zero
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
7764,
7877
]
} | 23,561 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | EIP20Interface | interface EIP20Interface {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
... | /**
* @title ERC 20 Token Standard Interface
* https://eips.ethereum.org/EIPS/eip-20
*/ | NatSpecMultiLine | totalSupply | function totalSupply() external view returns (uint256);
| /**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
319,
378
]
} | 23,562 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | EIP20Interface | interface EIP20Interface {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
... | /**
* @title ERC 20 Token Standard Interface
* https://eips.ethereum.org/EIPS/eip-20
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address owner) external view returns (uint256 balance);
| /**
* @notice Gets the balance of the specified address
* @param owner The address from which the balance will be retrieved
* @return The balance
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
553,
631
]
} | 23,563 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | EIP20Interface | interface EIP20Interface {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
... | /**
* @title ERC 20 Token Standard Interface
* https://eips.ethereum.org/EIPS/eip-20
*/ | NatSpecMultiLine | transfer | function transfer(address dst, uint256 amount) external returns (bool success);
| /**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
885,
968
]
} | 23,564 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | EIP20Interface | interface EIP20Interface {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
... | /**
* @title ERC 20 Token Standard Interface
* https://eips.ethereum.org/EIPS/eip-20
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address src, address dst, uint256 amount) external returns (bool success);
| /**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1268,
1368
]
} | 23,565 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | EIP20Interface | interface EIP20Interface {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
... | /**
* @title ERC 20 Token Standard Interface
* https://eips.ethereum.org/EIPS/eip-20
*/ | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) external returns (bool success);
| /**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param amount The number... | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1831,
1917
]
} | 23,566 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | EIP20Interface | interface EIP20Interface {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
... | /**
* @title ERC 20 Token Standard Interface
* https://eips.ethereum.org/EIPS/eip-20
*/ | NatSpecMultiLine | allowance | function allowance(address owner, address spender) external view returns (uint256 remaining);
| /**
* @notice Get the current allowance from `owner` for `spender`
* @param owner The address of the account which owns the tokens to be spent
* @param spender The address of the account which may transfer tokens
* @return The number of tokens allowed to be spent (-1 means infinite)
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
2240,
2337
]
} | 23,567 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | EIP20NonStandardInterface | interface EIP20NonStandardInterface {
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
function totalSupply() external view returns (uint256);
/**
* @notice Gets the balance of the specified address
* @param owner The address from which... | /**
* @title EIP20NonStandardInterface
* @dev Version of ERC20 with no return values for `transfer` and `transferFrom`
* See https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
*/ | NatSpecMultiLine | totalSupply | function totalSupply() external view returns (uint256);
| /**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
152,
211
]
} | 23,568 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | EIP20NonStandardInterface | interface EIP20NonStandardInterface {
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
function totalSupply() external view returns (uint256);
/**
* @notice Gets the balance of the specified address
* @param owner The address from which... | /**
* @title EIP20NonStandardInterface
* @dev Version of ERC20 with no return values for `transfer` and `transferFrom`
* See https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address owner) external view returns (uint256 balance);
| /**
* @notice Gets the balance of the specified address
* @param owner The address from which the balance will be retrieved
* @return The balance
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
386,
464
]
} | 23,569 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | EIP20NonStandardInterface | interface EIP20NonStandardInterface {
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
function totalSupply() external view returns (uint256);
/**
* @notice Gets the balance of the specified address
* @param owner The address from which... | /**
* @title EIP20NonStandardInterface
* @dev Version of ERC20 with no return values for `transfer` and `transferFrom`
* See https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
*/ | NatSpecMultiLine | transfer | function transfer(address dst, uint256 amount) external;
| /**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
827,
887
]
} | 23,570 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | EIP20NonStandardInterface | interface EIP20NonStandardInterface {
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
function totalSupply() external view returns (uint256);
/**
* @notice Gets the balance of the specified address
* @param owner The address from which... | /**
* @title EIP20NonStandardInterface
* @dev Version of ERC20 with no return values for `transfer` and `transferFrom`
* See https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address src, address dst, uint256 amount) external;
| /**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1300,
1377
]
} | 23,571 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | EIP20NonStandardInterface | interface EIP20NonStandardInterface {
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
function totalSupply() external view returns (uint256);
/**
* @notice Gets the balance of the specified address
* @param owner The address from which... | /**
* @title EIP20NonStandardInterface
* @dev Version of ERC20 with no return values for `transfer` and `transferFrom`
* See https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
*/ | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) external returns (bool success);
| /**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param amount The number... | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
1820,
1906
]
} | 23,572 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | EIP20NonStandardInterface | interface EIP20NonStandardInterface {
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
function totalSupply() external view returns (uint256);
/**
* @notice Gets the balance of the specified address
* @param owner The address from which... | /**
* @title EIP20NonStandardInterface
* @dev Version of ERC20 with no return values for `transfer` and `transferFrom`
* See https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
*/ | NatSpecMultiLine | allowance | function allowance(address owner, address spender) external view returns (uint256 remaining);
| /**
* @notice Get the current allowance from `owner` for `spender`
* @param owner The address of the account which owns the tokens to be spent
* @param spender The address of the account which may transfer tokens
* @return The number of tokens allowed to be spent
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
2209,
2306
]
} | 23,573 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | initialize | function initialize(ComptrollerInterface comptroller_,
InterestRateModel interestRateModel_,
uint initialExchangeRateMantissa_,
string memory name_,
string memory symbol_,
uint8 decimals_) public {
require(msg.sender == admin, "only admin may initialize the market");
require(accrualBlockNumb... | /**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate, scaled by 1e18
* @param name_ EIP-20 name of this token
* @param symbol_ EIP-20 symbol ... | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
503,
1925
]
} | 23,574 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | transferTokens | function transferTokens(address spender, address src, address dst, uint tokens) internal returns (uint) {
/* Fail if transfer not allowed */
uint allowed = comptroller.transferAllowed(address(this), src, dst, tokens);
if (allowed != 0) {
return failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.TRA... | /**
* @notice Transfer `tokens` tokens from `src` to `dst` by `spender`
* @dev Called by both `transfer` and `transferFrom` internally
* @param spender The address of the account performing the transfer
* @param src The address of the source account
* @param dst The address of the destination account
* @param tok... | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
2373,
4534
]
} | 23,575 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | transfer | function transfer(address dst, uint256 amount) external nonReentrant returns (bool) {
return transferTokens(msg.sender, msg.sender, dst, amount) == uint(Error.NO_ERROR);
}
| /**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
4783,
4970
]
} | 23,576 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address src, address dst, uint256 amount) external nonReentrant returns (bool) {
return transferTokens(msg.sender, src, dst, amount) == uint(Error.NO_ERROR);
}
| /**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
5264,
5461
]
} | 23,577 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) external returns (bool) {
address src = msg.sender;
transferAllowances[src][spender] = amount;
emit Approval(src, spender, amount);
return true;
}
| /**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param amount The number... | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
5917,
6153
]
} | 23,578 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | allowance | function allowance(address owner, address spender) external view returns (uint256) {
return transferAllowances[owner][spender];
}
| /**
* @notice Get the current allowance from `owner` for `spender`
* @param owner The address of the account which owns the tokens to be spent
* @param spender The address of the account which may transfer tokens
* @return The number of tokens allowed to be spent (-1 means infinite)
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
6471,
6616
]
} | 23,579 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address owner) external view returns (uint256) {
return accountTokens[owner];
}
| /**
* @notice Get the token balance of the `owner`
* @param owner The address of the account to query
* @return The number of tokens owned by `owner`
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
6795,
6909
]
} | 23,580 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | balanceOfUnderlying | function balanceOfUnderlying(address owner) external returns (uint) {
Exp memory exchangeRate = Exp({mantissa: exchangeRateCurrent()});
(MathError mErr, uint balance) = mulScalarTruncate(exchangeRate, accountTokens[owner]);
require(mErr == MathError.NO_ERROR, "balance could not be calculated");
return b... | /**
* @notice Get the underlying balance of the `owner`
* @dev This also accrues interest in a transaction
* @param owner The address of the account to query
* @return The amount of underlying owned by `owner`
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
7153,
7506
]
} | 23,581 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | getAccountSnapshot | function getAccountSnapshot(address account) external view returns (uint, uint, uint, uint) {
uint cTokenBalance = accountTokens[account];
uint borrowBalance;
uint exchangeRateMantissa;
MathError mErr;
(mErr, borrowBalance) = borrowBalanceStoredInternal(account);
if (mErr != MathError.NO_ERROR... | /**
* @notice Get a snapshot of the account's balances, and the cached exchange rate
* @dev This is used by comptroller to more efficiently perform liquidity checks.
* @param account Address of the account to snapshot
* @return (possible error, token balance, borrow balance, exchange rate mantissa)
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
7840,
8529
]
} | 23,582 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | getBlockNumber | function getBlockNumber() internal view returns (uint) {
return block.number;
}
| /**
* @dev Function to simply retrieve block number
* This exists mainly for inheriting test contracts to stub this result.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
8678,
8773
]
} | 23,583 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | borrowRatePerBlock | function borrowRatePerBlock() external view returns (uint) {
return interestRateModel.getBorrowRate(getCashPrior(), totalBorrows, totalReserves);
}
| /**
* @notice Returns the current per-block borrow interest rate for this gToken
* @return The borrow interest rate per block, scaled by 1e18
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
8939,
9102
]
} | 23,584 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | supplyRatePerBlock | function supplyRatePerBlock() external view returns (uint) {
return interestRateModel.getSupplyRate(getCashPrior(), totalBorrows, totalReserves, reserveFactorMantissa);
}
| /**
* @notice Returns the current per-block supply interest rate for this gToken
* @return The supply interest rate per block, scaled by 1e18
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
9268,
9454
]
} | 23,585 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | totalBorrowsCurrent | function totalBorrowsCurrent() external nonReentrant returns (uint) {
require(accrueInterest() == uint(Error.NO_ERROR), "accrue interest failed");
return totalBorrows;
}
| /**
* @notice Returns the current total borrows plus accrued interest
* @return The total borrows with interest
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
9590,
9783
]
} | 23,586 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | borrowBalanceCurrent | function borrowBalanceCurrent(address account) external nonReentrant returns (uint) {
require(accrueInterest() == uint(Error.NO_ERROR), "accrue interest failed");
return borrowBalanceStored(account);
}
| /**
* @notice Accrue interest to updated borrowIndex and then calculate account's borrow balance using the updated borrowIndex
* @param account The address whose balance should be calculated after updating borrowIndex
* @return The calculated balance
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
10063,
10288
]
} | 23,587 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | borrowBalanceStored | function borrowBalanceStored(address account) public view returns (uint) {
(MathError err, uint result) = borrowBalanceStoredInternal(account);
require(err == MathError.NO_ERROR, "borrowBalanceStored: borrowBalanceStoredInternal failed");
return result;
}
| /**
* @notice Return the borrow balance of account based on stored data
* @param account The address whose balance should be calculated
* @return The calculated balance
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
10486,
10773
]
} | 23,588 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | borrowBalanceStoredInternal | function borrowBalanceStoredInternal(address account) internal view returns (MathError, uint) {
/* Note: we do not assert that the market is up to date */
MathError mathErr;
uint principalTimesIndex;
uint result;
/* Get borrowBalance and borrowIndex */
BorrowSnapshot storage borrowSnapshot = ac... | /**
* @notice Return the borrow balance of account based on stored data
* @param account The address whose balance should be calculated
* @return (error code, the calculated balance or 0 if error code is non-zero)
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
11016,
12258
]
} | 23,589 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | exchangeRateCurrent | function exchangeRateCurrent() public nonReentrant returns (uint) {
require(accrueInterest() == uint(Error.NO_ERROR), "accrue interest failed");
return exchangeRateStored();
}
| /**
* @notice Accrue interest then return the up-to-date exchange rate
* @return Calculated exchange rate scaled by 1e18
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
12403,
12602
]
} | 23,590 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | exchangeRateStored | function exchangeRateStored() public view returns (uint) {
(MathError err, uint result) = exchangeRateStoredInternal();
require(err == MathError.NO_ERROR, "exchangeRateStored: exchangeRateStoredInternal failed");
return result;
}
| /**
* @notice Calculates the exchange rate from the underlying to the GToken
* @dev This function does not accrue interest before calculating the exchange rate
* @return Calculated exchange rate scaled by 1e18
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
12841,
13102
]
} | 23,591 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | exchangeRateStoredInternal | function exchangeRateStoredInternal() internal view returns (MathError, uint) {
uint _totalSupply = totalSupply;
if (_totalSupply == 0) {
/*
* If there are no tokens minted:
* exchangeRate = initialExchangeRate
*/
return (MathError.NO_ERROR, initialExchangeRateMantiss... | /**
* @notice Calculates the exchange rate from the underlying to the GToken
* @dev This function does not accrue interest before calculating the exchange rate
* @return (error code, calculated exchange rate scaled by 1e18)
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
13355,
14515
]
} | 23,592 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | getCash | function getCash() external view returns (uint) {
return getCashPrior();
}
| /**
* @notice Get cash balance of this gToken in the underlying asset
* @return The quantity of underlying asset owned by this contract
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
14675,
14765
]
} | 23,593 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | accrueInterest | function accrueInterest() public returns (uint) {
/* Remember the initial block number */
uint currentBlockNumber = getBlockNumber();
uint accrualBlockNumberPrior = accrualBlockNumber;
/* Short-circuit accumulating 0 interest */
if (accrualBlockNumberPrior == currentBlockNumber) {
return ui... | /**
* @notice Applies accrued interest to total borrows and reserves
* @dev This calculates interest accrued from the last checkpointed block
* up to the current block and writes new checkpoint to storage.
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
15002,
18780
]
} | 23,594 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | mintInternal | function mintInternal(uint mintAmount) internal nonReentrant returns (uint, uint) {
uint error = accrueInterest();
if (error != uint(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed
return (fail(Error(error), FailureInfo... | /**
* @notice Sender supplies assets into the market and receives cTokens in exchange
* @dev Accrues interest whether or not the operation succeeds, unless reverted
* @param mintAmount The amount of the underlying asset to supply
* @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporte... | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
19166,
19709
]
} | 23,595 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | mintFresh | function mintFresh(address minter, uint mintAmount) internal returns (uint, uint) {
/* Fail if mint not allowed */
uint allowed = comptroller.mintAllowed(address(this), minter, mintAmount);
if (allowed != 0) {
return (failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.MINT_COMPTROLLER_REJECTION, al... | /**
* @notice User supplies assets into the market and receives cTokens in exchange
* @dev Assumes interest has already been accrued up to the current block
* @param minter The address of the account which is supplying the assets
* @param mintAmount The amount of the underlying asset to supply
* @return (uint, uin... | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
20396,
23512
]
} | 23,596 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | redeemInternal | function redeemInternal(uint redeemTokens) internal nonReentrant returns (uint) {
uint error = accrueInterest();
if (error != uint(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but we still want to log the fact that an attempted redeem failed
return fail(Error(error), FailureInfo.RE... | /**
* @notice Sender redeems cTokens in exchange for the underlying asset
* @dev Accrues interest whether or not the operation succeeds, unless reverted
* @param redeemTokens The number of cTokens to redeem into underlying
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/ | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
23851,
24374
]
} | 23,597 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | redeemUnderlyingInternal | function redeemUnderlyingInternal(uint redeemAmount) internal nonReentrant returns (uint) {
uint error = accrueInterest();
if (error != uint(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but we still want to log the fact that an attempted redeem failed
return fail(Error(error), Fail... | /**
* @notice Sender redeems cTokens in exchange for a specified amount of underlying asset
* @dev Accrues interest whether or not the operation succeeds, unless reverted
* @param redeemAmount The amount of underlying to receive from redeeming cTokens
* @return uint 0=success, otherwise a failure (see ErrorReporter... | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
24742,
25275
]
} | 23,598 | ||
GErc20 | GErc20.sol | 0x41e76cbb5290edad9f101d1210f7f08013f732de | Solidity | GToken | contract GToken is GTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate,... | /**
* @title Gama's GToken Contract
* @notice Abstract base for CTokens
* @author gama
*/ | NatSpecMultiLine | redeemFresh | function redeemFresh(address payable redeemer, uint redeemTokensIn, uint redeemAmountIn) internal returns (uint) {
require(redeemTokensIn == 0 || redeemAmountIn == 0, "one of redeemTokensIn or redeemAmountIn must be zero");
RedeemLocalVars memory vars;
/* exchangeRate = invoke Exchange Rate Stored() */
... | /**
* @notice User redeems cTokens in exchange for the underlying asset
* @dev Assumes interest has already been accrued up to the current block
* @param redeemer The address of the account which is redeeming the tokens
* @param redeemTokensIn The number of cTokens to redeem into underlying (only one of redeemToken... | NatSpecMultiLine | v0.5.16+commit.9c3226ce | {
"func_code_index": [
26140,
30648
]
} | 23,599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.