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
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
IERC721Enumerable
interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to ...
/** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */
NatSpecMultiLine
tokenOfOwnerByIndex
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 365, 468 ] }
24,400
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
IERC721Enumerable
interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to ...
/** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */
NatSpecMultiLine
tokenByIndex
function tokenByIndex(uint256 index) external view returns (uint256);
/** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 639, 712 ] }
24,401
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; ...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
supportsInterface
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); }
/** * @dev See {IERC165-supportsInterface}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 589, 815 ] }
24,402
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; ...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
tokenOfOwnerByIndex
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; }
/** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 890, 1147 ] }
24,403
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; ...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
totalSupply
function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; }
/** * @dev See {IERC721Enumerable-totalSupply}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 1214, 1329 ] }
24,404
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; ...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
tokenByIndex
function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; }
/** * @dev See {IERC721Enumerable-tokenByIndex}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 1397, 1631 ] }
24,405
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; ...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
_beforeTokenTransfer
function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(fro...
/** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s ...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 2223, 2799 ] }
24,406
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; ...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
_addTokenToOwnerEnumeration
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; }
/** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 3089, 3310 ] }
24,407
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; ...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
_addTokenToAllTokensEnumeration
function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); }
/** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 3501, 3666 ] }
24,408
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; ...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
_removeTokenFromOwnerEnumeration
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 token...
/** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). *...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 4279, 5253 ] }
24,409
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; ...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
_removeTokenFromAllTokensEnumeration
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokens...
/** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 5537, 6602 ] }
24,410
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
WuXia
contract WuXia is ERC721Enumerable, ReentrancyGuard, Ownable { ERC721 lootContract = ERC721(0xFF9C1b15B16263C61d017ee9F65C50e4AE0113D7); uint256 public maxSupply = 10000; uint256 public freeSupply = 2000; uint256 public publicPrice = 20000000000000000; // 0.02 ETH string[] private martial = [ ...
random
function random(string memory input) internal pure returns (uint256) { return uint256(keccak256(abi.encodePacked(input))); }
//generating a random number
LineComment
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 6361, 6501 ] }
24,411
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
WuXia
contract WuXia is ERC721Enumerable, ReentrancyGuard, Ownable { ERC721 lootContract = ERC721(0xFF9C1b15B16263C61d017ee9F65C50e4AE0113D7); uint256 public maxSupply = 10000; uint256 public freeSupply = 2000; uint256 public publicPrice = 20000000000000000; // 0.02 ETH string[] private martial = [ ...
mint
function mint() public payable nonReentrant { require(publicPrice <= msg.value, "Not enough Ether sent"); require(totalSupply() < maxSupply, "All WuXia are minted"); _safeMint(msg.sender, totalSupply()); }
// Public minting
LineComment
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 10390, 10604 ] }
24,412
WuXia
contracts/WuxiaVerify.sol
0xcb04bee9137da128a769c1aa4db70640953337f9
Solidity
Base64
library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0...
/// [MIT License] /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <brecht@loopring.org>
NatSpecSingleLine
encode
function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return ""; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((len + 2) / 3); // Add some extra buffer at the end bytes memory result = new bytes(encodedLen + 32); byte...
/// @notice Encodes some bytes to the base64 representation
NatSpecSingleLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 186, 1747 ] }
24,413
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 259, 445 ] }
24,414
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 723, 864 ] }
24,415
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 1162, 1359 ] }
24,416
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 1613, 2089 ] }
24,417
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to reve...
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 2560, 2697 ] }
24,418
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
div
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an in...
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 3188, 3468 ] }
24,419
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
IERC20
interface IERC20 { function decimals() external view returns (uint8); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) ext...
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 144, 202 ] }
24,420
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
IERC20
interface IERC20 { function decimals() external view returns (uint8); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) ext...
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 279, 350 ] }
24,421
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
IERC20
interface IERC20 { function decimals() external view returns (uint8); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) ext...
transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 560, 640 ] }
24,422
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
IERC20
interface IERC20 { function decimals() external view returns (uint8); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) ext...
allowance
function allowance(address owner, address spender) external view returns (uint256);
/** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 905, 991 ] }
24,423
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
IERC20
interface IERC20 { function decimals() external view returns (uint8); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) ext...
approve
function approve(address spender, uint256 amount) external returns (bool);
/** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate ...
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 1627, 1704 ] }
24,424
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
IERC20
interface IERC20 { function decimals() external view returns (uint8); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) ext...
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 1999, 2099 ] }
24,425
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
isContract
function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly ...
/** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: ...
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 606, 1033 ] }
24,426
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
sendValue
function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address...
/** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `tr...
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 1963, 2365 ] }
24,427
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
functionCall
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); }
/** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw ...
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 3121, 3299 ] }
24,428
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
functionCall
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 3524, 3725 ] }
24,429
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ *...
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 4095, 4326 ] }
24,430
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disa...
/** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 4577, 5112 ] }
24,431
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
functionStaticCall
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 6277, 6481 ] }
24,432
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
functionStaticCall
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.stat...
/** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 6668, 7095 ] }
24,433
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
functionDelegateCall
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.3._ */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 7277, 7482 ] }
24,434
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
functionDelegateCall
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.deleg...
/** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.3._ */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 7671, 8099 ] }
24,435
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
SafeERC20
library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, add...
safeApprove
function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line ...
/** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 747, 1374 ] }
24,436
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
SafeERC20
library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, add...
_callOptionalReturn
function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target ad...
/** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi...
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 2393, 3159 ] }
24,437
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
GenerationalWealthSocietyStaking
contract GenerationalWealthSocietyStaking is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address public immutable GWS; address public immutable sGWS; struct Epoch { uint length; uint number; uint endBlock; uint distribute; } ...
stake
function stake( uint _amount, address _recipient ) external returns ( bool ) { if( initialStake[ _recipient ] == 0 ) { initialStake[ _recipient ] = epoch.number.add(initialUnstakeBlock); } rebase(); IERC20( GWS ).safeTransferFrom( msg.sender, address(this), _amount ); Cla...
/** @notice stake GWS to enter warmup @param _amount uint @return bool */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 1400, 2224 ] }
24,438
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
GenerationalWealthSocietyStaking
contract GenerationalWealthSocietyStaking is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address public immutable GWS; address public immutable sGWS; struct Epoch { uint length; uint number; uint endBlock; uint distribute; } ...
claim
function claim ( address _recipient ) public { Claim memory info = warmupInfo[ _recipient ]; if ( epoch.number >= info.expiry && info.expiry != 0 ) { delete warmupInfo[ _recipient ]; IWarmup( warmupContract ).retrieve( _recipient, IsGWS( sGWS ).balanceForGons( info.gons ) ); } }
/** @notice retrieve sGWS from warmup @param _recipient address */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 2323, 2665 ] }
24,439
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
GenerationalWealthSocietyStaking
contract GenerationalWealthSocietyStaking is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address public immutable GWS; address public immutable sGWS; struct Epoch { uint length; uint number; uint endBlock; uint distribute; } ...
forfeit
function forfeit() external { Claim memory info = warmupInfo[ msg.sender ]; delete warmupInfo[ msg.sender ]; IWarmup( warmupContract ).retrieve( address(this), IsGWS( sGWS ).balanceForGons( info.gons ) ); IERC20( GWS ).safeTransfer( msg.sender, info.deposit ); }
/** @notice forfeit sGWS in warmup and retrieve GWS */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 2743, 3053 ] }
24,440
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
GenerationalWealthSocietyStaking
contract GenerationalWealthSocietyStaking is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address public immutable GWS; address public immutable sGWS; struct Epoch { uint length; uint number; uint endBlock; uint distribute; } ...
toggleDepositLock
function toggleDepositLock() external { warmupInfo[ msg.sender ].lock = !warmupInfo[ msg.sender ].lock; }
/** @notice prevent new deposits to address (protection from malicious activity) */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 3160, 3284 ] }
24,441
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
GenerationalWealthSocietyStaking
contract GenerationalWealthSocietyStaking is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address public immutable GWS; address public immutable sGWS; struct Epoch { uint length; uint number; uint endBlock; uint distribute; } ...
unstake
function unstake( uint _amount, bool _trigger ) external { require( epoch.number >= initialStake[ msg.sender ] , 'Has not reached the initial unstake block' ); if ( _trigger ) { rebase(); } IERC20( sGWS ).safeTransferFrom( msg.sender, address(this), _amount ); IERC20( GWS ).safeTrans...
/** @notice redeem sGWS for GWS @param _amount uint @param _trigger bool */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 3401, 3784 ] }
24,442
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
GenerationalWealthSocietyStaking
contract GenerationalWealthSocietyStaking is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address public immutable GWS; address public immutable sGWS; struct Epoch { uint length; uint number; uint endBlock; uint distribute; } ...
index
function index() public view returns ( uint ) { return IsGWS( sGWS ).index(); }
/** @notice returns the sGWS index, which tracks rebase growth @return uint */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 3895, 3993 ] }
24,443
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
GenerationalWealthSocietyStaking
contract GenerationalWealthSocietyStaking is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address public immutable GWS; address public immutable sGWS; struct Epoch { uint length; uint number; uint endBlock; uint distribute; } ...
rebase
function rebase() public { if( epoch.endBlock <= block.number ) { IsGWS( sGWS ).rebase( epoch.distribute, epoch.number ); epoch.endBlock = epoch.endBlock.add( epoch.length ); epoch.number++; if ( distributor != address(0) ) { IDistributor( distributor ).distri...
/** @notice trigger rebase if epoch over */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 4060, 4736 ] }
24,444
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
GenerationalWealthSocietyStaking
contract GenerationalWealthSocietyStaking is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address public immutable GWS; address public immutable sGWS; struct Epoch { uint length; uint number; uint endBlock; uint distribute; } ...
contractBalance
function contractBalance() public view returns ( uint ) { return IERC20( GWS ).balanceOf( address(this) ).add( totalBonus ); }
/** @notice returns contract GWS holdings, including bonuses provided @return uint */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 4854, 4999 ] }
24,445
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
GenerationalWealthSocietyStaking
contract GenerationalWealthSocietyStaking is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address public immutable GWS; address public immutable sGWS; struct Epoch { uint length; uint number; uint endBlock; uint distribute; } ...
giveLockBonus
function giveLockBonus( uint _amount ) external { require( msg.sender == locker ); totalBonus = totalBonus.add( _amount ); IERC20( sGWS ).safeTransfer( locker, _amount ); }
/** @notice provide bonus to locked staking contract @param _amount uint */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 5107, 5316 ] }
24,446
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
GenerationalWealthSocietyStaking
contract GenerationalWealthSocietyStaking is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address public immutable GWS; address public immutable sGWS; struct Epoch { uint length; uint number; uint endBlock; uint distribute; } ...
returnLockBonus
function returnLockBonus( uint _amount ) external { require( msg.sender == locker ); totalBonus = totalBonus.sub( _amount ); IERC20( sGWS ).safeTransferFrom( locker, address(this), _amount ); }
/** @notice reclaim bonus from locked staking contract @param _amount uint */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 5426, 5656 ] }
24,447
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
GenerationalWealthSocietyStaking
contract GenerationalWealthSocietyStaking is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address public immutable GWS; address public immutable sGWS; struct Epoch { uint length; uint number; uint endBlock; uint distribute; } ...
setContract
function setContract( CONTRACTS _contract, address _address ) external onlyManager() { if( _contract == CONTRACTS.DISTRIBUTOR ) { // 0 distributor = _address; } else if ( _contract == CONTRACTS.WARMUP ) { // 1 require( warmupContract == address( 0 ), "Warmup cannot be set more than once" ); ...
/** @notice sets the contract address for LP staking @param _contract address */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 5823, 6398 ] }
24,448
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
GenerationalWealthSocietyStaking
contract GenerationalWealthSocietyStaking is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address public immutable GWS; address public immutable sGWS; struct Epoch { uint length; uint number; uint endBlock; uint distribute; } ...
setWarmup
function setWarmup( uint _warmupPeriod ) external onlyManager() { warmupPeriod = _warmupPeriod; }
/** * @notice set warmup period for new stakers * @param _warmupPeriod uint */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 6503, 6619 ] }
24,449
GenerationalWealthSocietyStaking
GenerationalWealthSocietyStaking.sol
0x842222bbaeceb854993c5ad3f63e98fdff214393
Solidity
GenerationalWealthSocietyStaking
contract GenerationalWealthSocietyStaking is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address public immutable GWS; address public immutable sGWS; struct Epoch { uint length; uint number; uint endBlock; uint distribute; } ...
setInitialUnstakeBlock
function setInitialUnstakeBlock( uint _initialUnstakeBlock ) external onlyManager() { initialUnstakeBlock = _initialUnstakeBlock; }
/** * @notice set initial unstake block. * @notice The first time a user stakes he needs to wait x epoch numbers before the user can unstake * @param _initialUnstakeBlock uint */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
MIT
ipfs://d98426dc6a0f560c88d4ce3fcc28406cb1cb2f028b2164f11e747947c026d5b0
{ "func_code_index": [ 6827, 6977 ] }
24,450
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
initialize
function initialize(ComptrollerInterface comptroller_, InterestRateModel interestRateModel_, uint initialExchangeRateMantissa_, string memory name_, string memory symbol_, uint8 decimals_) public { require(msg.sender...
/** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate, scaled by 1e18 * @param name_ EIP-20 name of this token * @param symbol_ EIP-20 symbol ...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 503, 2005 ] }
24,451
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
transferTokens
function transferTokens(address spender, address src, address dst, uint tokens) internal returns (uint) { /* Fail if transfer not allowed */ uint allowed = comptroller.transferAllowed(address(this), src, dst, tokens); if (allowed != 0) { return failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.TRA...
/** * @notice Transfer `tokens` tokens from `src` to `dst` by `spender` * @dev Called by both `transfer` and `transferFrom` internally * @param spender The address of the account performing the transfer * @param src The address of the source account * @param dst The address of the destination account * @param tok...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 2453, 4614 ] }
24,452
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 4863, 5050 ] }
24,453
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 5344, 5541 ] }
24,454
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 5997, 6233 ] }
24,455
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 6551, 6696 ] }
24,456
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 6875, 6989 ] }
24,457
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 7233, 7586 ] }
24,458
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
getAccountSnapshot
function getAccountSnapshot(address account) external view returns (uint, uint, uint, uint) { uint sTokenBalance = accountTokens[account]; uint borrowBalance; uint exchangeRateMantissa; MathError mErr; (mErr, borrowBalance) = borrowBalanceStoredInternal(account); if (mErr != MathError.NO_ERROR...
/** * @notice Get a snapshot of the account's balances, and the cached exchange rate * @dev This is used by comptroller to more efficiently perform liquidity checks. * @param account Address of the account to snapshot * @return (possible error, token balance, borrow balance, exchange rate mantissa) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 7920, 8609 ] }
24,459
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 8758, 8853 ] }
24,460
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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 sToken * @return The borrow interest rate per block, scaled by 1e18 */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 9019, 9182 ] }
24,461
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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 sToken * @return The supply interest rate per block, scaled by 1e18 */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 9348, 9534 ] }
24,462
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 9670, 9863 ] }
24,463
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 10143, 10368 ] }
24,464
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 10566, 10853 ] }
24,465
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 11096, 12338 ] }
24,466
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 12483, 12682 ] }
24,467
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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 SToken * @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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 12921, 13182 ] }
24,468
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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 SToken * @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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 13435, 14595 ] }
24,469
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
getCash
function getCash() external view returns (uint) { return getCashPrior(); }
/** * @notice Get cash balance of this sToken in the underlying asset * @return The quantity of underlying asset owned by this contract */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 14755, 14845 ] }
24,470
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 15082, 18860 ] }
24,471
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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 sTokens 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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 19246, 19789 ] }
24,472
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
mintFresh
function mintFresh(address minter, uint mintAmount) internal returns (uint, uint) { /* Fail if mint not allowed */ uint allowed = comptroller.mintAllowed(address(this), minter, mintAmount); if (allowed != 0) { return (failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.MINT_COMPTROLLER_REJECTION, al...
/** * @notice User supplies assets into the market and receives sTokens 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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 20476, 23592 ] }
24,473
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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 sTokens in exchange for the underlying asset * @dev Accrues interest whether or not the operation succeeds, unless reverted * @param redeemTokens The number of sTokens to redeem into underlying * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 23931, 24454 ] }
24,474
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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 sTokens 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 sTokens * @return uint 0=success, otherwise a failure (see ErrorReporter...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 24822, 25355 ] }
24,475
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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 sTokens 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 sTokens to redeem into underlying (only one of redeemToken...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 26220, 30728 ] }
24,476
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 30985, 31505 ] }
24,477
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
borrowFresh
function borrowFresh(address payable borrower, uint borrowAmount) internal returns (uint) { /* Fail if borrow not allowed */ uint allowed = comptroller.borrowAllowed(address(this), borrower, borrowAmount); if (allowed != 0) { return failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.BORROW_COMPTROL...
/** * @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
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 31914, 34889 ] }
24,478
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
repayBorrowInternal
function repayBorrowInternal(uint repayAmount) 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), Fai...
/** * @notice Sender repays their own borrow * @param repayAmount The amount to repay * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 35131, 35699 ] }
24,479
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
repayBorrowBehalfInternal
function repayBorrowBehalfInternal(address borrower, uint repayAmount) 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...
/** * @notice Sender repays a borrow belonging to borrower * @param borrower the account with the debt being payed off * @param repayAmount The amount to repay * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 36020, 36610 ] }
24,480
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
repayBorrowFresh
function repayBorrowFresh(address payer, address borrower, uint repayAmount) internal returns (uint, uint) { /* Fail if repayBorrow not allowed */ uint allowed = comptroller.repayBorrowAllowed(address(this), payer, borrower, repayAmount); if (allowed != 0) { return (failOpaque(Error.COMPTROLLER_REJE...
/** * @notice Borrows are repaid by another user (possibly the borrower). * @param payer the account paying off the borrow * @param borrower the account with the debt being payed off * @param repayAmount the amount of undelrying tokens being returned * @return (uint, uint) An error code (0=success, otherwise a fai...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 37291, 40638 ] }
24,481
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
liquidateBorrowInternal
function liquidateBorrowInternal(address borrower, uint repayAmount, STokenInterface sTokenCollateral) 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 attemp...
/** * @notice The sender liquidates the borrowers collateral. * The collateral seized is transferred to the liquidator. * @param borrower The borrower of this sToken to be liquidated * @param sTokenCollateral The market in which to seize collateral from the borrower * @param repayAmount The amount of the underlyi...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 41151, 42134 ] }
24,482
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
liquidateBorrowFresh
function liquidateBorrowFresh(address liquidator, address borrower, uint repayAmount, STokenInterface sTokenCollateral) internal returns (uint, uint) { /* Fail if liquidate not allowed */ uint allowed = comptroller.liquidateBorrowAllowed(address(this), address(sTokenCollateral), liquidator, borrower, repayAmoun...
/** * @notice The liquidator liquidates the borrowers collateral. * The collateral seized is transferred to the liquidator. * @param borrower The borrower of this sToken to be liquidated * @param liquidator The address repaying the borrow and seizing collateral * @param sTokenCollateral The market in which to sei...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 42731, 46249 ] }
24,483
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
seize
function seize(address liquidator, address borrower, uint seizeTokens) external nonReentrant returns (uint) { return seizeInternal(msg.sender, liquidator, borrower, seizeTokens); }
/** * @notice Transfers collateral tokens (this market) to the liquidator. * @dev Will fail unless called by another sToken during the process of liquidation. * Its absolutely critical to use msg.sender as the borrowed sToken and not a parameter. * @param liquidator The account receiving seized collateral * @para...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 46795, 46991 ] }
24,484
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
seizeInternal
function seizeInternal(address seizerToken, address liquidator, address borrower, uint seizeTokens) internal returns (uint) { /* Fail if seize not allowed */ uint allowed = comptroller.seizeAllowed(address(this), seizerToken, liquidator, borrower, seizeTokens); if (allowed != 0) { return failOpaque(...
/** * @notice Transfers collateral tokens (this market) to the liquidator. * @dev Called only during an in-kind liquidation, or by liquidateBorrow during the liquidation of another SToken. * Its absolutely critical to use msg.sender as the seizer sToken and not a parameter. * @param seizerToken The contract seizin...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 47650, 49747 ] }
24,485
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
_setPendingAdmin
function _setPendingAdmin(address payable newPendingAdmin) external returns (uint) { // Check caller = admin if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_ADMIN_OWNER_CHECK); } // Save current value, if any, for inclusion in log address oldPendingAdmin =...
/** * @notice Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer. * @dev Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer. * @param newPendingAdmin New pending admin. * @return uint 0=success, otherwise...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 50181, 50816 ] }
24,486
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
_acceptAdmin
function _acceptAdmin() external returns (uint) { // Check caller is pendingAdmin and pendingAdmin ≠ address(0) if (msg.sender != pendingAdmin || msg.sender == address(0)) { return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_ADMIN_PENDING_ADMIN_CHECK); } // Save current values for inclusion in ...
/** * @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin * @dev Admin function for pending admin to accept role and update admin * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 51083, 51807 ] }
24,487
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
_setComptroller
function _setComptroller(ComptrollerInterface newComptroller) public returns (uint) { // Check caller is admin if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.SET_COMPTROLLER_OWNER_CHECK); } ComptrollerInterface oldComptroller = comptroller; // Ensure invoke comptroll...
/** * @notice Sets a new comptroller for the market * @dev Admin function to set a new comptroller * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 52021, 52743 ] }
24,488
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
_setReserveFactor
function _setReserveFactor(uint newReserveFactorMantissa) external nonReentrant returns (uint) { uint error = accrueInterest(); if (error != uint(Error.NO_ERROR)) { // accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted reserve factor change failed. ...
/** * @notice accrues interest and sets a new reserve factor for the protocol using _setReserveFactorFresh * @dev Admin function to accrue interest and set a new reserve factor * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 53035, 53638 ] }
24,489
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
_setReserveFactorFresh
function _setReserveFactorFresh(uint newReserveFactorMantissa) internal returns (uint) { // Check caller is admin if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.SET_RESERVE_FACTOR_ADMIN_CHECK); } // Verify market's block number equals current block number if (accrual...
/** * @notice Sets a new reserve factor for the protocol (*requires fresh interest accrual) * @dev Admin function to set a new reserve factor * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 53895, 54848 ] }
24,490
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
_addReservesInternal
function _addReservesInternal(uint addAmount) internal nonReentrant returns (uint) { uint error = accrueInterest(); if (error != uint(Error.NO_ERROR)) { // accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted reduce reserves failed. return fail(Error(...
/** * @notice Accrues interest and reduces reserves by transferring from msg.sender * @param addAmount Amount of addition to reserves * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 55093, 55677 ] }
24,491
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
_addReservesFresh
function _addReservesFresh(uint addAmount) internal returns (uint, uint) { // totalReserves + actualAddAmount uint totalReservesNew; uint actualAddAmount; // We fail gracefully unless market's block number equals current block number if (accrualBlockNumber != getBlockNumber()) { return (fai...
/** * @notice Add reserves by transferring from caller * @dev Requires fresh interest accrual * @param addAmount Amount of addition to reserves * @return (uint, uint) An error code (0=success, otherwise a failure (see ErrorReporter.sol for details)) and the actual amount added, net token fees */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 56005, 57603 ] }
24,492
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
_reduceReserves
function _reduceReserves(uint reduceAmount) external nonReentrant returns (uint) { uint error = accrueInterest(); if (error != uint(Error.NO_ERROR)) { // accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted reduce reserves failed. return fail(Error(er...
/** * @notice Accrues interest and reduces reserves by transferring to admin * @param reduceAmount Amount of reduction to reserves * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 57846, 58413 ] }
24,493
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
_reduceReservesFresh
function _reduceReservesFresh(uint reduceAmount) internal returns (uint) { // totalReserves - reduceAmount uint totalReservesNew; // Check caller is admin if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.REDUCE_RESERVES_ADMIN_CHECK); } // We fail gracefully unless...
/** * @notice Reduces reserves by transferring to admin * @dev Requires fresh interest accrual * @param reduceAmount Amount of reduction to reserves * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 58678, 60386 ] }
24,494
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
_setInterestRateModel
function _setInterestRateModel(InterestRateModel newInterestRateModel) public returns (uint) { uint error = accrueInterest(); if (error != uint(Error.NO_ERROR)) { // accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted change of interest rate model failed ...
/** * @notice accrues interest and updates the interest rate model using _setInterestRateModelFresh * @dev Admin function to accrue interest and update the interest rate model * @param newInterestRateModel the new interest rate model to use * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for de...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 60743, 61372 ] }
24,495
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
_setInterestRateModelFresh
function _setInterestRateModelFresh(InterestRateModel newInterestRateModel) internal returns (uint) { // Used to store old model for use in the event that is emitted on success InterestRateModel oldInterestRateModel; // Check caller is admin if (msg.sender != admin) { return fail(Error.UNAUTHO...
/** * @notice updates the interest rate model (*requires fresh interest accrual) * @dev Admin function to update the interest rate model * @param newInterestRateModel the new interest rate model to use * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 61690, 62965 ] }
24,496
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
getCashPrior
function getCashPrior() internal view returns (uint);
/** * @notice Gets balance of this contract in terms of the underlying * @dev This excludes the value of the current message, if any * @return The quantity of underlying owned by this contract */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 63213, 63270 ] }
24,497
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
doTransferIn
function doTransferIn(address from, uint amount) internal returns (uint);
/** * @dev Performs a transfer in, reverting upon failure. Returns the amount actually transferred to the protocol, in case of a fee. * This may revert due to insufficient balance or insufficient allowance. */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 63502, 63579 ] }
24,498
StrikePriceOracle
SToken.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SToken
contract SToken is STokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Strike's SToken Contract * @notice Abstract base for STokens * @author Strike */
NatSpecMultiLine
doTransferOut
function doTransferOut(address payable to, uint amount) internal;
/** * @dev Performs a transfer out, ideally returning an explanatory error code upon failure tather than reverting. * If caller has not called checked protocol's balance, may revert due to insufficient cash held in the contract. * If caller has checked protocol's balance, and verified it is >= amount, this should ...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 63958, 64027 ] }
24,499