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
QNTU
QNTU.sol
0x4234f63b1d202f6c016ca3b6a0d41d7d85f17716
Solidity
QNTU
contract QNTU is UpgradableToken, PausableToken { /** * @dev Constructor */ function QNTU(address[] _wallets, uint[] _amount) public { require(_wallets.length == _amount.length); symbol = "QNTU"; name = "QNTU Token"; decimals = 18; u...
/** * @title QNTU 1.0 token */
NatSpecMultiLine
transferToContract
function transferToContract(address _to, uint _value) public canTransfer returns (bool) { require(_value > 0); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ReceivingContract receiver = ReceivingContract(_to); receive...
/** * @dev Transfer token for a specified contract * @param _to The address to transfer to. * @param _value The amount to be transferred. */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://7b2322c984aba8e3e0ec830a52d277a41c06b6784a66d81856018224b990ea68
{ "func_code_index": [ 828, 1300 ] }
6,300
BiosRewards
contracts/bios_rewards.sol
0x3a9cd4c36b4ff8c51ddcf6bf6da927fec156460d
Solidity
BiosRewards
contract BiosRewards is LPTokenWrapper, IRewardDistributionRecipient, ERC677Receiver { IERC20 public immutable rewardToken; uint256 public immutable duration; uint256 public periodFinish = 0; uint256 public rewardRate = 0; uint256 public lastUpdateTime; uint256 public rewardPerTokenStore...
stake
function stake(uint256 amount) public override updateReward(msg.sender) { require(amount > 0, "Cannot stake 0"); super.stake(amount); emit Staked(msg.sender, amount); }
// stake visibility is public as overriding LPTokenWrapper's stake() function
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://a727dc1c76184231f41bd8a918df513f3f749ab9f38a9276cdea37864b11ac34
{ "func_code_index": [ 2471, 2676 ] }
6,301
SBToken
SBToken.sol
0xcadb96858fe496bb6309622f9023ba2defb5d540
Solidity
SafeMath
contract SafeMath { // Overflow protected math functions /** @dev returns the sum of _x and _y, asserts if the calculation overflows @param _x value 1 @param _y value 2 @return sum */ function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint25...
safeAdd
function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) { uint256 z = _x + _y; require(z >= _x); //assert(z >= _x); return z; }
/** @dev returns the sum of _x and _y, asserts if the calculation overflows @param _x value 1 @param _y value 2 @return sum */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://3bb88cafcaa3b0ddf7ddae8f59f2c48b16b66de610e999428668f7d96ef7fdda
{ "func_code_index": [ 246, 434 ] }
6,302
SBToken
SBToken.sol
0xcadb96858fe496bb6309622f9023ba2defb5d540
Solidity
SafeMath
contract SafeMath { // Overflow protected math functions /** @dev returns the sum of _x and _y, asserts if the calculation overflows @param _x value 1 @param _y value 2 @return sum */ function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint25...
safeSub
function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) { require(_x >= _y); //assert(_x >= _y); return _x - _y; }
/** @dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number @param _x minuend @param _y subtrahend @return difference */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://3bb88cafcaa3b0ddf7ddae8f59f2c48b16b66de610e999428668f7d96ef7fdda
{ "func_code_index": [ 656, 822 ] }
6,303
SBToken
SBToken.sol
0xcadb96858fe496bb6309622f9023ba2defb5d540
Solidity
SafeMath
contract SafeMath { // Overflow protected math functions /** @dev returns the sum of _x and _y, asserts if the calculation overflows @param _x value 1 @param _y value 2 @return sum */ function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint25...
safeMul
function safeMul(uint256 _x, uint256 _y) internal pure returns (uint256) { uint256 z = _x * _y; require(_x == 0 || z / _x == _y); //assert(_x == 0 || z / _x == _y); return z; }
/** @dev returns the product of multiplying _x by _y, asserts if the calculation overflows @param _x factor 1 @param _y factor 2 @return product */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://3bb88cafcaa3b0ddf7ddae8f59f2c48b16b66de610e999428668f7d96ef7fdda
{ "func_code_index": [ 1027, 1247 ] }
6,304
SBToken
SBToken.sol
0xcadb96858fe496bb6309622f9023ba2defb5d540
Solidity
SBToken
contract SBToken is SafeMath { mapping (address => uint256) balances; address public owner; string public name; string public symbol; uint8 public decimals = 18; // total amount of tokens uint256 public totalSupply; // `allowed` tracks any extra transfer rights as in all ERC20 token...
balanceOf
function balanceOf(address _owner) public view returns (uint256 balance) { eturn balances[_owner];
/// @param _owner The address from which the balance will be retrieved /// @return The balance
NatSpecSingleLine
v0.5.11+commit.c082d0b4
MIT
bzzr://3bb88cafcaa3b0ddf7ddae8f59f2c48b16b66de610e999428668f7d96ef7fdda
{ "func_code_index": [ 773, 885 ] }
6,305
SBToken
SBToken.sol
0xcadb96858fe496bb6309622f9023ba2defb5d540
Solidity
SBToken
contract SBToken is SafeMath { mapping (address => uint256) balances; address public owner; string public name; string public symbol; uint8 public decimals = 18; // total amount of tokens uint256 public totalSupply; // `allowed` tracks any extra transfer rights as in all ERC20 token...
transfer
function transfer(address _to, uint256 _value) public returns (bool success) { require(_value > 0 ); // Check send token value > 0; quire(balances[msg.sender] >= _value); // Check if the sender has enough require(balances[_to] + _value > balances[_t...
/// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not
NatSpecSingleLine
v0.5.11+commit.c082d0b4
MIT
bzzr://3bb88cafcaa3b0ddf7ddae8f59f2c48b16b66de610e999428668f7d96ef7fdda
{ "func_code_index": [ 1122, 1937 ] }
6,306
SBToken
SBToken.sol
0xcadb96858fe496bb6309622f9023ba2defb5d540
Solidity
SBToken
contract SBToken is SafeMath { mapping (address => uint256) balances; address public owner; string public name; string public symbol; uint8 public decimals = 18; // total amount of tokens uint256 public totalSupply; // `allowed` tracks any extra transfer rights as in all ERC20 token...
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(balances[_from] >= _value); // Check if the sender has enough require(balances[_to] + _value >= balances[_to]); // Check for overflows require(_value <= allowed[_from][msg.sender]...
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not
NatSpecSingleLine
v0.5.11+commit.c082d0b4
MIT
bzzr://3bb88cafcaa3b0ddf7ddae8f59f2c48b16b66de610e999428668f7d96ef7fdda
{ "func_code_index": [ 2260, 3061 ] }
6,307
SBToken
SBToken.sol
0xcadb96858fe496bb6309622f9023ba2defb5d540
Solidity
SBToken
contract SBToken is SafeMath { mapping (address => uint256) balances; address public owner; string public name; string public symbol; uint8 public decimals = 18; // total amount of tokens uint256 public totalSupply; // `allowed` tracks any extra transfer rights as in all ERC20 token...
approve
function approve(address _spender, uint256 _value) public returns (bool success) { quire(balances[msg.sender] >= _value); lowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); turn true;
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not
NatSpecSingleLine
v0.5.11+commit.c082d0b4
MIT
bzzr://3bb88cafcaa3b0ddf7ddae8f59f2c48b16b66de610e999428668f7d96ef7fdda
{ "func_code_index": [ 3351, 3602 ] }
6,308
SBToken
SBToken.sol
0xcadb96858fe496bb6309622f9023ba2defb5d540
Solidity
SBToken
contract SBToken is SafeMath { mapping (address => uint256) balances; address public owner; string public name; string public symbol; uint8 public decimals = 18; // total amount of tokens uint256 public totalSupply; // `allowed` tracks any extra transfer rights as in all ERC20 token...
allowance
function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender];
/// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent
NatSpecSingleLine
v0.5.11+commit.c082d0b4
MIT
bzzr://3bb88cafcaa3b0ddf7ddae8f59f2c48b16b66de610e999428668f7d96ef7fdda
{ "func_code_index": [ 3811, 3957 ] }
6,309
SBToken
SBToken.sol
0xcadb96858fe496bb6309622f9023ba2defb5d540
Solidity
SBToken
contract SBToken is SafeMath { mapping (address => uint256) balances; address public owner; string public name; string public symbol; uint8 public decimals = 18; // total amount of tokens uint256 public totalSupply; // `allowed` tracks any extra transfer rights as in all ERC20 token...
_burn
function _burn(address _account, uint256 _value) internal { require(_account == address(0), "ERC20: burn to the zero address"); totalSupply = safeSub(totalSupply, _value); }
/// @param _account must be the zero address and must have at least `amount` tokens /// @param _value The amount of tokens to been burned
NatSpecSingleLine
v0.5.11+commit.c082d0b4
MIT
bzzr://3bb88cafcaa3b0ddf7ddae8f59f2c48b16b66de610e999428668f7d96ef7fdda
{ "func_code_index": [ 4107, 4309 ] }
6,310
SBToken
SBToken.sol
0xcadb96858fe496bb6309622f9023ba2defb5d540
Solidity
SBToken
contract SBToken is SafeMath { mapping (address => uint256) balances; address public owner; string public name; string public symbol; uint8 public decimals = 18; // total amount of tokens uint256 public totalSupply; // `allowed` tracks any extra transfer rights as in all ERC20 token...
function () external { revert(); // Prevents accidental sending of ether }
/* This unnamed function is called whenever someone tries to send ether to it */
Comment
v0.5.11+commit.c082d0b4
MIT
bzzr://3bb88cafcaa3b0ddf7ddae8f59f2c48b16b66de610e999428668f7d96ef7fdda
{ "func_code_index": [ 4396, 4493 ] }
6,311
OwnedUpgradeabilityProxy
OwnedUpgradeabilityProxy.sol
0x895b5fe62645c47d37fe5cc3bc9246621f5e47bb
Solidity
OwnedUpgradeabilityProxy
contract OwnedUpgradeabilityProxy is UpgradeabilityProxy { /** * @dev Event to show ownership has been transferred * @param previousOwner representing the address of the previous owner * @param newOwner representing the address of the new owner */ event ProxyOwnershipTransferred(address previousOwner, addre...
/** * @title OwnedUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with basic authorization control functionalities */
NatSpecMultiLine
proxyOwner
function proxyOwner() public view returns (address owner) { bytes32 position = proxyOwnerPosition; assembly { owner := sload(position) } }
/** * @dev Tells the address of the owner * @return the address of the owner */
NatSpecMultiLine
v0.5.9+commit.e560f70d
Apache-2.0
bzzr://8743d7295a9e30092dbf278b16cce18ba70ce00b7984f4a5c5d0f58be82ceaab
{ "func_code_index": [ 891, 1051 ] }
6,312
OwnedUpgradeabilityProxy
OwnedUpgradeabilityProxy.sol
0x895b5fe62645c47d37fe5cc3bc9246621f5e47bb
Solidity
OwnedUpgradeabilityProxy
contract OwnedUpgradeabilityProxy is UpgradeabilityProxy { /** * @dev Event to show ownership has been transferred * @param previousOwner representing the address of the previous owner * @param newOwner representing the address of the new owner */ event ProxyOwnershipTransferred(address previousOwner, addre...
/** * @title OwnedUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with basic authorization control functionalities */
NatSpecMultiLine
setUpgradeabilityOwner
function setUpgradeabilityOwner(address newProxyOwner) internal { bytes32 position = proxyOwnerPosition; assembly { sstore(position, newProxyOwner) } }
/** * @dev Sets the address of the owner */
NatSpecMultiLine
v0.5.9+commit.e560f70d
Apache-2.0
bzzr://8743d7295a9e30092dbf278b16cce18ba70ce00b7984f4a5c5d0f58be82ceaab
{ "func_code_index": [ 1105, 1278 ] }
6,313
OwnedUpgradeabilityProxy
OwnedUpgradeabilityProxy.sol
0x895b5fe62645c47d37fe5cc3bc9246621f5e47bb
Solidity
OwnedUpgradeabilityProxy
contract OwnedUpgradeabilityProxy is UpgradeabilityProxy { /** * @dev Event to show ownership has been transferred * @param previousOwner representing the address of the previous owner * @param newOwner representing the address of the new owner */ event ProxyOwnershipTransferred(address previousOwner, addre...
/** * @title OwnedUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with basic authorization control functionalities */
NatSpecMultiLine
transferProxyOwnership
function transferProxyOwnership(address newOwner) public onlyProxyOwner { require(newOwner != address(0)); emit ProxyOwnershipTransferred(proxyOwner(), newOwner); setUpgradeabilityOwner(newOwner); }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.5.9+commit.e560f70d
Apache-2.0
bzzr://8743d7295a9e30092dbf278b16cce18ba70ce00b7984f4a5c5d0f58be82ceaab
{ "func_code_index": [ 1437, 1651 ] }
6,314
OwnedUpgradeabilityProxy
OwnedUpgradeabilityProxy.sol
0x895b5fe62645c47d37fe5cc3bc9246621f5e47bb
Solidity
OwnedUpgradeabilityProxy
contract OwnedUpgradeabilityProxy is UpgradeabilityProxy { /** * @dev Event to show ownership has been transferred * @param previousOwner representing the address of the previous owner * @param newOwner representing the address of the new owner */ event ProxyOwnershipTransferred(address previousOwner, addre...
/** * @title OwnedUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with basic authorization control functionalities */
NatSpecMultiLine
upgradeTo
function upgradeTo(address implementation) public onlyProxyOwner { _upgradeTo(implementation); }
/** * @dev Allows the proxy owner to upgrade the current version of the proxy. * @param implementation representing the address of the new implementation to be set. */
NatSpecMultiLine
v0.5.9+commit.e560f70d
Apache-2.0
bzzr://8743d7295a9e30092dbf278b16cce18ba70ce00b7984f4a5c5d0f58be82ceaab
{ "func_code_index": [ 1832, 1936 ] }
6,315
OwnedUpgradeabilityProxy
OwnedUpgradeabilityProxy.sol
0x895b5fe62645c47d37fe5cc3bc9246621f5e47bb
Solidity
OwnedUpgradeabilityProxy
contract OwnedUpgradeabilityProxy is UpgradeabilityProxy { /** * @dev Event to show ownership has been transferred * @param previousOwner representing the address of the previous owner * @param newOwner representing the address of the new owner */ event ProxyOwnershipTransferred(address previousOwner, addre...
/** * @title OwnedUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with basic authorization control functionalities */
NatSpecMultiLine
upgradeToAndCall
function upgradeToAndCall(address implementation, bytes memory data) payable public onlyProxyOwner { upgradeTo(implementation); (bool success,) = address(this).call.value(msg.value)(data); require(success); }
/** * @dev Allows the proxy owner to upgrade the current version of the proxy and call the new implementation * to initialize whatever is needed through a low level call. * @param implementation representing the address of the new implementation to be set. * @param data represents the msg.data to bet sent in the lo...
NatSpecMultiLine
v0.5.9+commit.e560f70d
Apache-2.0
bzzr://8743d7295a9e30092dbf278b16cce18ba70ce00b7984f4a5c5d0f58be82ceaab
{ "func_code_index": [ 2402, 2626 ] }
6,316
GrowToken
GrowToken.sol
0x832ec40433b457028a1d27434f3b9fdf81aaecbe
Solidity
SafeMath
library SafeMath { /* * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /* * @d...
/* * @title SafeMath * @dev Math operations with safety checks that throw on error */
Comment
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; }
/* * @dev Multiplies two numbers, throws on overflow. */
Comment
v0.4.25+commit.59dbf8f1
bzzr://be538c703fe0f7390dd7c96b80dddbd44a767561698c802ea73aae1115890ad5
{ "func_code_index": [ 94, 301 ] }
6,317
GrowToken
GrowToken.sol
0x832ec40433b457028a1d27434f3b9fdf81aaecbe
Solidity
SafeMath
library SafeMath { /* * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /* * @d...
/* * @title SafeMath * @dev Math operations with safety checks that throw on error */
Comment
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; }
/* * @dev Integer division of two numbers, truncating the quotient. */
Comment
v0.4.25+commit.59dbf8f1
bzzr://be538c703fe0f7390dd7c96b80dddbd44a767561698c802ea73aae1115890ad5
{ "func_code_index": [ 390, 690 ] }
6,318
GrowToken
GrowToken.sol
0x832ec40433b457028a1d27434f3b9fdf81aaecbe
Solidity
SafeMath
library SafeMath { /* * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /* * @d...
/* * @title SafeMath * @dev Math operations with safety checks that throw on error */
Comment
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
/* * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
Comment
v0.4.25+commit.59dbf8f1
bzzr://be538c703fe0f7390dd7c96b80dddbd44a767561698c802ea73aae1115890ad5
{ "func_code_index": [ 809, 937 ] }
6,319
GrowToken
GrowToken.sol
0x832ec40433b457028a1d27434f3b9fdf81aaecbe
Solidity
SafeMath
library SafeMath { /* * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /* * @d...
/* * @title SafeMath * @dev Math operations with safety checks that throw on error */
Comment
add
function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; }
/* * @dev Adds two numbers, throws on overflow. */
Comment
v0.4.25+commit.59dbf8f1
bzzr://be538c703fe0f7390dd7c96b80dddbd44a767561698c802ea73aae1115890ad5
{ "func_code_index": [ 1006, 1152 ] }
6,320
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BControllerInterface
contract BControllerInterface { /// @notice Indicator that this is a BController contract (for inspection) bool public constant isBController = true; /*** Assets You Are In ***/ function enterMarkets(address[] calldata bTokens) external returns (uint[] memory); function exitMarket(address bToken) ...
/** * @title Bird's BController Interface */
NatSpecMultiLine
enterMarkets
function enterMarkets(address[] calldata bTokens) external returns (uint[] memory);
/*** Assets You Are In ***/
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 192, 279 ] }
6,321
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BControllerInterface
contract BControllerInterface { /// @notice Indicator that this is a BController contract (for inspection) bool public constant isBController = true; /*** Assets You Are In ***/ function enterMarkets(address[] calldata bTokens) external returns (uint[] memory); function exitMarket(address bToken) ...
/** * @title Bird's BController Interface */
NatSpecMultiLine
mintAllowed
function mintAllowed(address bToken, address minter, uint mintAmount) external returns (uint);
/*** Policy Hooks ***/
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 374, 472 ] }
6,322
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BControllerInterface
contract BControllerInterface { /// @notice Indicator that this is a BController contract (for inspection) bool public constant isBController = true; /*** Assets You Are In ***/ function enterMarkets(address[] calldata bTokens) external returns (uint[] memory); function exitMarket(address bToken) ...
/** * @title Bird's BController Interface */
NatSpecMultiLine
liquidateCalculateSeizeTokens
function liquidateCalculateSeizeTokens(address bTokenBorrowed, address bTokenCollateral, uint repayAmount) external view returns (uint, uint);
/*** Liquidity/Liquidation Calculations ***/
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 2141, 2287 ] }
6,323
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 Bird's InterestRateModel Interface */
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 amount of reserves the market has * @return The borrow rate per block (as a percentage, and s...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 542, 638 ] }
6,324
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 Bird's InterestRateModel Interface */
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 amount of reserves the market has * @param reserveFactorMantissa The current reserve factor t...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 1092, 1216 ] }
6,325
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BTokenInterface
contract BTokenInterface is BTokenStorage { /** * @notice Indicator that this is a BToken contract (for inspection) */ bool public constant isBToken = true; /*** Market Events ***/ /** * @notice Event emitted when interest is accrued */ event AccrueInterestToken(uint cashPrior...
/** * @title Bird's BToken Interface */
NatSpecMultiLine
transfer
function transfer(address dst, uint amount) external returns (bool);
/*** User Interface ***/
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 2854, 2926 ] }
6,326
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BTokenInterface
contract BTokenInterface is BTokenStorage { /** * @notice Indicator that this is a BToken contract (for inspection) */ bool public constant isBToken = true; /*** Market Events ***/ /** * @notice Event emitted when interest is accrued */ event AccrueInterestToken(uint cashPrior...
/** * @title Bird's BToken Interface */
NatSpecMultiLine
_setPendingAdmin
function _setPendingAdmin(address payable newPendingAdmin) external returns (uint);
/*** Admin Functions ***/
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 4116, 4203 ] }
6,327
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BErc20Interface
contract BErc20Interface is BErc20Storage { /*** 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...
/** * @title Bird's BErc20 Interface */
NatSpecMultiLine
mint
function mint(uint mintAmount) external returns (uint);
/*** User Interface ***/
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 75, 134 ] }
6,328
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BErc20Interface
contract BErc20Interface is BErc20Storage { /*** 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...
/** * @title Bird's BErc20 Interface */
NatSpecMultiLine
_addReserves
function _addReserves(uint addAmount) external returns (uint);
/*** Admin Functions ***/
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 654, 720 ] }
6,329
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BDelegatorInterface
contract BDelegatorInterface is BDelegationStorage { /** * @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...
/** * @title Bird's BDelegator Interface */
NatSpecMultiLine
_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 ] }
6,330
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BDelegateInterface
contract BDelegateInterface is BDelegationStorage { /** * @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...
/** * @title Bird's BDelegate Interface */
NatSpecMultiLine
_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 ] }
6,331
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BDelegateInterface
contract BDelegateInterface is BDelegationStorage { /** * @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...
/** * @title Bird's BDelegate Interface */
NatSpecMultiLine
_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 ] }
6,332
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BControllerErrorReporter
contract BControllerErrorReporter { enum Error { NO_ERROR, UNAUTHORIZED, BCONTROLLER_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 ] }
6,333
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BControllerErrorReporter
contract BControllerErrorReporter { enum Error { NO_ERROR, UNAUTHORIZED, BCONTROLLER_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 ] }
6,334
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
TokenErrorReporter
contract TokenErrorReporter { enum Error { NO_ERROR, UNAUTHORIZED, BAD_INPUT, BCONTROLLER_REJECTION, BCONTROLLER_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 ] }
6,335
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
TokenErrorReporter
contract TokenErrorReporter { enum Error { NO_ERROR, UNAUTHORIZED, BAD_INPUT, BCONTROLLER_REJECTION, BCONTROLLER_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 ] }
6,336
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,337
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,338
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,339
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,340
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,341
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,342
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,343
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,344
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,345
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,346
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,347
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,348
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,349
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,350
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,351
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,352
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,353
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,354
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,355
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,356
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,357
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,358
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 * @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 ] }
6,359
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 ] }
6,360
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 ] }
6,361
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 ] }
6,362
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 ] }
6,363
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 ] }
6,364
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 ] }
6,365
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 ] }
6,366
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 ] }
6,367
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 ] }
6,368
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 ] }
6,369
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 ] }
6,370
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
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 ] }
6,371
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
NatSpecMultiLine
initialize
function initialize(BControllerInterface bController_, InterestRateModel interestRateModel_, uint initialExchangeRateMantissa_, string memory name_, string memory symbol_, uint8 decimals_) public { require(msg.sender...
/** * @notice Initialize the money market * @param bController_ The address of the BController * @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": [ 504, 2006 ] }
6,372
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
NatSpecMultiLine
transferTokens
function transferTokens(address spender, address src, address dst, uint tokens) internal returns (uint) { /* Fail if transfer not allowed */ uint allowed = bController.transferAllowed(address(this), src, dst, tokens); if (allowed != 0) { return failOpaque(Error.BCONTROLLER_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": [ 2454, 4615 ] }
6,373
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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": [ 4864, 5051 ] }
6,374
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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": [ 5345, 5542 ] }
6,375
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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": [ 5998, 6234 ] }
6,376
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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": [ 6552, 6697 ] }
6,377
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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": [ 6876, 6990 ] }
6,378
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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": [ 7234, 7587 ] }
6,379
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
NatSpecMultiLine
getAccountSnapshot
function getAccountSnapshot(address account) external view returns (uint, uint, uint, uint) { uint bTokenBalance = 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 bController 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": [ 7921, 8610 ] }
6,380
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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": [ 8759, 8854 ] }
6,381
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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 bToken * @return The borrow interest rate per block, scaled by 1e18 */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 9020, 9183 ] }
6,382
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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 bToken * @return The supply interest rate per block, scaled by 1e18 */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 9349, 9535 ] }
6,383
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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": [ 9671, 9864 ] }
6,384
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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": [ 10144, 10369 ] }
6,385
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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": [ 10567, 10854 ] }
6,386
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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": [ 11097, 12339 ] }
6,387
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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": [ 12484, 12683 ] }
6,388
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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 BToken * @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": [ 12922, 13183 ] }
6,389
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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 BToken * @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": [ 13436, 14596 ] }
6,390
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
NatSpecMultiLine
getCash
function getCash() external view returns (uint) { return getCashPrior(); }
/** * @notice Get cash balance of this bToken in the underlying asset * @return The quantity of underlying asset owned by this contract */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 14756, 14846 ] }
6,391
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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": [ 15083, 18866 ] }
6,392
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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 bTokens 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": [ 19252, 19795 ] }
6,393
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
NatSpecMultiLine
mintFresh
function mintFresh(address minter, uint mintAmount) internal returns (uint, uint) { /* Fail if mint not allowed */ uint allowed = bController.mintAllowed(address(this), minter, mintAmount); if (allowed != 0) { return (failOpaque(Error.BCONTROLLER_REJECTION, FailureInfo.MINT_BCONTROLLER_REJECTION, a...
/** * @notice User supplies assets into the market and receives bTokens 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": [ 20482, 23604 ] }
6,394
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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 bTokens in exchange for the underlying asset * @dev Accrues interest whether or not the operation succeeds, unless reverted * @param redeemTokens The number of bTokens 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": [ 23943, 24466 ] }
6,395
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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 bTokens 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 bTokens * @return uint 0=success, otherwise a failure (see ErrorReporter...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 24834, 25367 ] }
6,396
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
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 bTokens 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 bTokens to redeem into underlying (only one of redeemToken...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 26232, 30746 ] }
6,397
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
NatSpecMultiLine
borrowInternal
function borrowInternal(uint borrowAmount) 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 borrow failed return fail(Error(error), FailureInfo.BO...
/** * @notice Sender borrows assets from the protocol to their own address * @param borrowAmount The amount of the underlying asset to borrow * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 31003, 31523 ] }
6,398
SimplePriceOracle
SimplePriceOracle.sol
0x624128c9f71dc9ca6876f2f75d6e8f64899209d7
Solidity
BToken
contract BToken is BTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param bController_ The address of the BController * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate...
/** * @title Bird's BToken Contract * @notice Abstract base for BTokens */
NatSpecMultiLine
borrowFresh
function borrowFresh(address payable borrower, uint borrowAmount) internal returns (uint) { /* Fail if borrow not allowed */ uint allowed = bController.borrowAllowed(address(this), borrower, borrowAmount); if (allowed != 0) { return failOpaque(Error.BCONTROLLER_REJECTION, FailureInfo.BORROW_BCONTROL...
/** * @notice Users borrow assets from the protocol to their own address * @param borrowAmount The amount of the underlying asset to borrow * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 31932, 34912 ] }
6,399