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
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
borrowInternal
function borrowInternal(uint borrowAmount) internal nonReentrant returns (uint) { uint error = accrueInterest(); if (error != uint(Error.NO_ERROR)) { // accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed return fail(Error(error), FailureInfo.BO...
/** * @notice Sender borrows assets from the protocol to their own address * @param borrowAmount The amount of the underlying asset to borrow * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 30905, 31425 ] }
23,600
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
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
{ "func_code_index": [ 31834, 34809 ] }
23,601
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
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
{ "func_code_index": [ 35051, 35619 ] }
23,602
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
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
{ "func_code_index": [ 35940, 36530 ] }
23,603
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
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
{ "func_code_index": [ 37211, 40558 ] }
23,604
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
liquidateBorrowInternal
function liquidateBorrowInternal(address borrower, uint repayAmount, GTokenInterface cTokenCollateral) 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 gToken to be liquidated * @param cTokenCollateral The market in which to seize collateral from the borrower * @param repayAmount The amount of the underlyi...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 41071, 42054 ] }
23,605
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
liquidateBorrowFresh
function liquidateBorrowFresh(address liquidator, address borrower, uint repayAmount, GTokenInterface cTokenCollateral) internal returns (uint, uint) { /* Fail if liquidate not allowed */ uint allowed = comptroller.liquidateBorrowAllowed(address(this), address(cTokenCollateral), liquidator, borrower, repayAmoun...
/** * @notice The liquidator liquidates the borrowers collateral. * The collateral seized is transferred to the liquidator. * @param borrower The borrower of this gToken to be liquidated * @param liquidator The address repaying the borrow and seizing collateral * @param cTokenCollateral The market in which to sei...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 42651, 46169 ] }
23,606
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
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 gToken during the process of liquidation. * Its absolutely critical to use msg.sender as the borrowed gToken and not a parameter. * @param liquidator The account receiving seized collateral * @para...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 46715, 46911 ] }
23,607
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
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 GToken. * Its absolutely critical to use msg.sender as the seizer gToken and not a parameter. * @param seizerToken The contract seizin...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 47570, 49667 ] }
23,608
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
_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
{ "func_code_index": [ 50101, 50736 ] }
23,609
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
_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
{ "func_code_index": [ 51003, 51727 ] }
23,610
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
_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
{ "func_code_index": [ 51941, 52663 ] }
23,611
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
_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
{ "func_code_index": [ 52955, 53558 ] }
23,612
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
_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
{ "func_code_index": [ 53815, 54768 ] }
23,613
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
_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
{ "func_code_index": [ 55013, 55597 ] }
23,614
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
_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
{ "func_code_index": [ 55925, 57523 ] }
23,615
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
_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
{ "func_code_index": [ 57766, 58333 ] }
23,616
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
_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
{ "func_code_index": [ 58598, 60306 ] }
23,617
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
_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
{ "func_code_index": [ 60663, 61292 ] }
23,618
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
_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
{ "func_code_index": [ 61610, 62885 ] }
23,619
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
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
{ "func_code_index": [ 63133, 63190 ] }
23,620
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
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
{ "func_code_index": [ 63422, 63499 ] }
23,621
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GToken
contract GToken is GTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
/** * @title Gama's GToken Contract * @notice Abstract base for CTokens * @author gama */
NatSpecMultiLine
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
{ "func_code_index": [ 63878, 63947 ] }
23,622
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GErc20
contract GErc20 is GToken, CErc20Interface { constructor() public { admin = msg.sender; } /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The a...
/** * @title Gama's GErc20 Contract * @notice GToken which wrap an EIP-20 underlying * @author gama */
NatSpecMultiLine
initialize
function initialize(address underlying_, ComptrollerInterface comptroller_, InterestRateModel interestRateModel_, uint initialExchangeRateMantissa_, string memory name_, string memory symbol_, uint8 d...
/** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @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 na...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 606, 1281 ] }
23,623
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GErc20
contract GErc20 is GToken, CErc20Interface { constructor() public { admin = msg.sender; } /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The a...
/** * @title Gama's GErc20 Contract * @notice GToken which wrap an EIP-20 underlying * @author gama */
NatSpecMultiLine
mint
function mint(uint mintAmount) external returns (uint) { (uint err,) = mintInternal(mintAmount); return err; }
/** * @notice Sender supplies assets into the market and receives cTokens in exchange * @dev Accrues interest whether or not the operation succeeds, unless reverted * @param mintAmount The amount of the underlying asset to supply * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 1657, 1791 ] }
23,624
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GErc20
contract GErc20 is GToken, CErc20Interface { constructor() public { admin = msg.sender; } /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The a...
/** * @title Gama's GErc20 Contract * @notice GToken which wrap an EIP-20 underlying * @author gama */
NatSpecMultiLine
redeem
function redeem(uint redeemTokens) external returns (uint) { return redeemInternal(redeemTokens); }
/** * @notice Sender redeems cTokens in exchange for the underlying asset * @dev Accrues interest whether or not the operation succeeds, unless reverted * @param redeemTokens The number of cTokens to redeem into underlying * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 2130, 2245 ] }
23,625
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GErc20
contract GErc20 is GToken, CErc20Interface { constructor() public { admin = msg.sender; } /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The a...
/** * @title Gama's GErc20 Contract * @notice GToken which wrap an EIP-20 underlying * @author gama */
NatSpecMultiLine
redeemUnderlying
function redeemUnderlying(uint redeemAmount) external returns (uint) { return redeemUnderlyingInternal(redeemAmount); }
/** * @notice Sender redeems cTokens in exchange for a specified amount of underlying asset * @dev Accrues interest whether or not the operation succeeds, unless reverted * @param redeemAmount The amount of underlying to redeem * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 2589, 2724 ] }
23,626
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GErc20
contract GErc20 is GToken, CErc20Interface { constructor() public { admin = msg.sender; } /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The a...
/** * @title Gama's GErc20 Contract * @notice GToken which wrap an EIP-20 underlying * @author gama */
NatSpecMultiLine
borrow
function borrow(uint borrowAmount) external returns (uint) { return borrowInternal(borrowAmount); }
/** * @notice Sender borrows assets from the protocol to their own address * @param borrowAmount The amount of the underlying asset to borrow * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 2981, 3096 ] }
23,627
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GErc20
contract GErc20 is GToken, CErc20Interface { constructor() public { admin = msg.sender; } /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The a...
/** * @title Gama's GErc20 Contract * @notice GToken which wrap an EIP-20 underlying * @author gama */
NatSpecMultiLine
repayBorrow
function repayBorrow(uint repayAmount) external returns (uint) { (uint err,) = repayBorrowInternal(repayAmount); return err; }
/** * @notice Sender repays their own borrow * @param repayAmount The amount to repay * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 3293, 3443 ] }
23,628
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GErc20
contract GErc20 is GToken, CErc20Interface { constructor() public { admin = msg.sender; } /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The a...
/** * @title Gama's GErc20 Contract * @notice GToken which wrap an EIP-20 underlying * @author gama */
NatSpecMultiLine
repayBorrowBehalf
function repayBorrowBehalf(address borrower, uint repayAmount) external returns (uint) { (uint err,) = repayBorrowBehalfInternal(borrower, repayAmount); return err; }
/** * @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 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 3719, 3909 ] }
23,629
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GErc20
contract GErc20 is GToken, CErc20Interface { constructor() public { admin = msg.sender; } /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The a...
/** * @title Gama's GErc20 Contract * @notice GToken which wrap an EIP-20 underlying * @author gama */
NatSpecMultiLine
liquidateBorrow
function liquidateBorrow(address borrower, uint repayAmount, GTokenInterface cTokenCollateral) external returns (uint) { (uint err,) = liquidateBorrowInternal(borrower, repayAmount, cTokenCollateral); return err; }
/** * @notice The sender liquidates the borrowers collateral. * The collateral seized is transferred to the liquidator. * @param borrower The borrower of this gToken to be liquidated * @param repayAmount The amount of the underlying borrowed asset to repay * @param cTokenCollateral The market in which to seize co...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 4377, 4615 ] }
23,630
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GErc20
contract GErc20 is GToken, CErc20Interface { constructor() public { admin = msg.sender; } /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The a...
/** * @title Gama's GErc20 Contract * @notice GToken which wrap an EIP-20 underlying * @author gama */
NatSpecMultiLine
_addReserves
function _addReserves(uint addAmount) external returns (uint) { return _addReservesInternal(addAmount); }
/** * @notice The sender adds to reserves. * @param addAmount The amount fo underlying token to add as reserves * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 4838, 4959 ] }
23,631
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GErc20
contract GErc20 is GToken, CErc20Interface { constructor() public { admin = msg.sender; } /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The a...
/** * @title Gama's GErc20 Contract * @notice GToken which wrap an EIP-20 underlying * @author gama */
NatSpecMultiLine
getCashPrior
function getCashPrior() internal view returns (uint) { EIP20Interface token = EIP20Interface(underlying); return token.balanceOf(address(this)); }
/** * @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 tokens owned by this contract */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 5214, 5384 ] }
23,632
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GErc20
contract GErc20 is GToken, CErc20Interface { constructor() public { admin = msg.sender; } /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The a...
/** * @title Gama's GErc20 Contract * @notice GToken which wrap an EIP-20 underlying * @author gama */
NatSpecMultiLine
doTransferIn
function doTransferIn(address from, uint amount) internal returns (uint) { EIP20NonStandardInterface token = EIP20NonStandardInterface(underlying); uint balanceBefore = EIP20Interface(underlying).balanceOf(address(this)); token.transferFrom(from, address(this), amount); bool success; assembly { ...
/** * @dev Similar to EIP20 transfer, except it handles a False result from `transferFrom` and reverts in that case. * This will revert due to insufficient balance or insufficient allowance. * This function returns the actual amount received, * which may be less than `amount` if there is a fee attach...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 5986, 7309 ] }
23,633
GErc20
GErc20.sol
0x41e76cbb5290edad9f101d1210f7f08013f732de
Solidity
GErc20
contract GErc20 is GToken, CErc20Interface { constructor() public { admin = msg.sender; } /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The a...
/** * @title Gama's GErc20 Contract * @notice GToken which wrap an EIP-20 underlying * @author gama */
NatSpecMultiLine
doTransferOut
function doTransferOut(address payable to, uint amount) internal { EIP20NonStandardInterface token = EIP20NonStandardInterface(underlying); token.transfer(to, amount); bool success; assembly { switch returndatasize() case 0 { // This is a non-standard ERC-20 ...
/** * @dev Similar to EIP20 transfer, except it handles a False success from `transfer` and returns an explanatory * error code rather than reverting. If caller has not called checked protocol's balance, this may revert due to * insufficient cash held in this contract. If caller has checked protocol's bala...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
{ "func_code_index": [ 7998, 8887 ] }
23,634
StrikePriceOracle
SErc20.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SErc20
contract SErc20 is SToken, SErc20Interface { /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchang...
/** * @title Strike's SErc20 Contract * @notice STokens which wrap an EIP-20 underlying * @author Strike */
NatSpecMultiLine
initialize
function initialize(address underlying_, ComptrollerInterface comptroller_, InterestRateModel interestRateModel_, uint initialExchangeRateMantissa_, string memory name_, string memory symbol_, uint8 d...
/** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @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 na...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 544, 1219 ] }
23,635
StrikePriceOracle
SErc20.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SErc20
contract SErc20 is SToken, SErc20Interface { /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchang...
/** * @title Strike's SErc20 Contract * @notice STokens which wrap an EIP-20 underlying * @author Strike */
NatSpecMultiLine
mint
function mint(uint mintAmount) external returns (uint) { (uint err,) = mintInternal(mintAmount); return err; }
/** * @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 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 1595, 1729 ] }
23,636
StrikePriceOracle
SErc20.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SErc20
contract SErc20 is SToken, SErc20Interface { /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchang...
/** * @title Strike's SErc20 Contract * @notice STokens which wrap an EIP-20 underlying * @author Strike */
NatSpecMultiLine
redeem
function redeem(uint redeemTokens) external returns (uint) { return redeemInternal(redeemTokens); }
/** * @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": [ 2068, 2183 ] }
23,637
StrikePriceOracle
SErc20.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SErc20
contract SErc20 is SToken, SErc20Interface { /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchang...
/** * @title Strike's SErc20 Contract * @notice STokens which wrap an EIP-20 underlying * @author Strike */
NatSpecMultiLine
redeemUnderlying
function redeemUnderlying(uint redeemAmount) external returns (uint) { return redeemUnderlyingInternal(redeemAmount); }
/** * @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 redeem * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 2527, 2662 ] }
23,638
StrikePriceOracle
SErc20.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SErc20
contract SErc20 is SToken, SErc20Interface { /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchang...
/** * @title Strike's SErc20 Contract * @notice STokens which wrap an EIP-20 underlying * @author Strike */
NatSpecMultiLine
borrow
function borrow(uint borrowAmount) external returns (uint) { return borrowInternal(borrowAmount); }
/** * @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": [ 2919, 3034 ] }
23,639
StrikePriceOracle
SErc20.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SErc20
contract SErc20 is SToken, SErc20Interface { /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchang...
/** * @title Strike's SErc20 Contract * @notice STokens which wrap an EIP-20 underlying * @author Strike */
NatSpecMultiLine
repayBorrow
function repayBorrow(uint repayAmount) external returns (uint) { (uint err,) = repayBorrowInternal(repayAmount); return err; }
/** * @notice Sender repays their own borrow * @param repayAmount The amount to repay * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 3231, 3381 ] }
23,640
StrikePriceOracle
SErc20.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SErc20
contract SErc20 is SToken, SErc20Interface { /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchang...
/** * @title Strike's SErc20 Contract * @notice STokens which wrap an EIP-20 underlying * @author Strike */
NatSpecMultiLine
repayBorrowBehalf
function repayBorrowBehalf(address borrower, uint repayAmount) external returns (uint) { (uint err,) = repayBorrowBehalfInternal(borrower, repayAmount); return err; }
/** * @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 0=success, otherwise a failure (see ErrorReporter.sol for details) */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 3657, 3847 ] }
23,641
StrikePriceOracle
SErc20.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SErc20
contract SErc20 is SToken, SErc20Interface { /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchang...
/** * @title Strike's SErc20 Contract * @notice STokens which wrap an EIP-20 underlying * @author Strike */
NatSpecMultiLine
liquidateBorrow
function liquidateBorrow(address borrower, uint repayAmount, STokenInterface sTokenCollateral) external returns (uint) { (uint err,) = liquidateBorrowInternal(borrower, repayAmount, sTokenCollateral); return err; }
/** * @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 repayAmount The amount of the underlying borrowed asset to repay * @param sTokenCollateral The market in which to seize co...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 4315, 4553 ] }
23,642
StrikePriceOracle
SErc20.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SErc20
contract SErc20 is SToken, SErc20Interface { /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchang...
/** * @title Strike's SErc20 Contract * @notice STokens which wrap an EIP-20 underlying * @author Strike */
NatSpecMultiLine
_addReserves
function _addReserves(uint addAmount) external returns (uint) { return _addReservesInternal(addAmount); }
/** * @notice The sender adds to reserves. * @param addAmount The amount fo underlying token to add as 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": [ 4776, 4897 ] }
23,643
StrikePriceOracle
SErc20.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SErc20
contract SErc20 is SToken, SErc20Interface { /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchang...
/** * @title Strike's SErc20 Contract * @notice STokens which wrap an EIP-20 underlying * @author Strike */
NatSpecMultiLine
getCashPrior
function getCashPrior() internal view returns (uint) { EIP20Interface token = EIP20Interface(underlying); return token.balanceOf(address(this)); }
/** * @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 tokens owned by this contract */
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 5152, 5322 ] }
23,644
StrikePriceOracle
SErc20.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SErc20
contract SErc20 is SToken, SErc20Interface { /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchang...
/** * @title Strike's SErc20 Contract * @notice STokens which wrap an EIP-20 underlying * @author Strike */
NatSpecMultiLine
doTransferIn
function doTransferIn(address from, uint amount) internal returns (uint) { EIP20NonStandardInterface token = EIP20NonStandardInterface(underlying); uint balanceBefore = EIP20Interface(underlying).balanceOf(address(this)); token.transferFrom(from, address(this), amount); bool success; assembly { ...
/** * @dev Similar to EIP20 transfer, except it handles a False result from `transferFrom` and reverts in that case. * This will revert due to insufficient balance or insufficient allowance. * This function returns the actual amount received, * which may be less than `amount` if there is a fee attach...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 5924, 7247 ] }
23,645
StrikePriceOracle
SErc20.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
SErc20
contract SErc20 is SToken, SErc20Interface { /** * @notice Initialize the new money market * @param underlying_ The address of the underlying asset * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchang...
/** * @title Strike's SErc20 Contract * @notice STokens which wrap an EIP-20 underlying * @author Strike */
NatSpecMultiLine
doTransferOut
function doTransferOut(address payable to, uint amount) internal { EIP20NonStandardInterface token = EIP20NonStandardInterface(underlying); token.transfer(to, amount); bool success; assembly { switch returndatasize() case 0 { // This is a non-standard ERC-20 ...
/** * @dev Similar to EIP20 transfer, except it handles a False success from `transfer` and returns an explanatory * error code rather than reverting. If caller has not called checked protocol's balance, this may revert due to * insufficient cash held in this contract. If caller has checked protocol's bala...
NatSpecMultiLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 7936, 8825 ] }
23,646
StakeImperial
StakeImperial.sol
0x12f720ee40d09e404fd5b04db9691bdf1dc1c933
Solidity
StakeImperial
contract StakeImperial is Ownable { //Setup of public variables for maintaing between contract transactions address private ImperialAddress = address(0x25cef4fb106e76080e88135a0e4059276fa9be87); tokenToTransfer private sendtTransaction; //Setup of staking variables for contract maintenance ...
displayUserStake
function displayUserStake(address user) public view onlyOwner returns (uint256) { return stake[user]; }
//Admin change address to updated address function
LineComment
v0.4.24+commit.e67f0147
None
bzzr://31537fd3e0a63505feade553132527d9daa5b5a0b4279404994fe9b1512c5b0a
{ "func_code_index": [ 2982, 3104 ] }
23,647
StakeImperial
StakeImperial.sol
0x12f720ee40d09e404fd5b04db9691bdf1dc1c933
Solidity
StakeImperial
contract StakeImperial is Ownable { //Setup of public variables for maintaing between contract transactions address private ImperialAddress = address(0x25cef4fb106e76080e88135a0e4059276fa9be87); tokenToTransfer private sendtTransaction; //Setup of staking variables for contract maintenance ...
changeReward
function changeReward(uint256 change) public onlyOwner { reward = change; }
//Admin change reward function
LineComment
v0.4.24+commit.e67f0147
None
bzzr://31537fd3e0a63505feade553132527d9daa5b5a0b4279404994fe9b1512c5b0a
{ "func_code_index": [ 3489, 3583 ] }
23,648
StakeImperial
StakeImperial.sol
0x12f720ee40d09e404fd5b04db9691bdf1dc1c933
Solidity
StakeImperial
contract StakeImperial is Ownable { //Setup of public variables for maintaing between contract transactions address private ImperialAddress = address(0x25cef4fb106e76080e88135a0e4059276fa9be87); tokenToTransfer private sendtTransaction; //Setup of staking variables for contract maintenance ...
changeTimeVariable
function changeTimeVariable(uint256 change) public onlyOwner { timeVariable = change; }
//Admin change reward function
LineComment
v0.4.24+commit.e67f0147
None
bzzr://31537fd3e0a63505feade553132527d9daa5b5a0b4279404994fe9b1512c5b0a
{ "func_code_index": [ 3626, 3732 ] }
23,649
StakeImperial
StakeImperial.sol
0x12f720ee40d09e404fd5b04db9691bdf1dc1c933
Solidity
StakeImperial
contract StakeImperial is Ownable { //Setup of public variables for maintaing between contract transactions address private ImperialAddress = address(0x25cef4fb106e76080e88135a0e4059276fa9be87); tokenToTransfer private sendtTransaction; //Setup of staking variables for contract maintenance ...
changeRewardtoLower
function changeRewardtoLower(bool value) public onlyOwner { higherReward = value; }
//Admin reward function for lower than 100%
LineComment
v0.4.24+commit.e67f0147
None
bzzr://31537fd3e0a63505feade553132527d9daa5b5a0b4279404994fe9b1512c5b0a
{ "func_code_index": [ 3788, 3890 ] }
23,650
StakeImperial
StakeImperial.sol
0x12f720ee40d09e404fd5b04db9691bdf1dc1c933
Solidity
StakeImperial
contract StakeImperial is Ownable { //Setup of public variables for maintaing between contract transactions address private ImperialAddress = address(0x25cef4fb106e76080e88135a0e4059276fa9be87); tokenToTransfer private sendtTransaction; //Setup of staking variables for contract maintenance ...
resetTime
function resetTime() public onlyOwner { time = now; }
//Admin reset time balance to reset stake to new level
LineComment
v0.4.24+commit.e67f0147
None
bzzr://31537fd3e0a63505feade553132527d9daa5b5a0b4279404994fe9b1512c5b0a
{ "func_code_index": [ 3957, 4029 ] }
23,651
StrikePriceOracle
StrikePriceOracle.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
IStdReference
interface IStdReference { /// A structure returned whenever someone requests for standard reference data. struct ReferenceData { uint256 rate; // base/quote exchange rate, multiplied by 1e18. uint256 lastUpdatedBase; // UNIX epoch of the last time when base price gets updated. uint256 la...
getReferenceData
function getReferenceData(string calldata _base, string calldata _quote) external view returns (ReferenceData memory);
/// Returns the price data for the given base/quote pair. Revert if not available.
NatSpecSingleLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 492, 614 ] }
23,652
StrikePriceOracle
StrikePriceOracle.sol
0x2257ba009e8d2f9b342e80968992d5a3abf2fd51
Solidity
IStdReference
interface IStdReference { /// A structure returned whenever someone requests for standard reference data. struct ReferenceData { uint256 rate; // base/quote exchange rate, multiplied by 1e18. uint256 lastUpdatedBase; // UNIX epoch of the last time when base price gets updated. uint256 la...
getReferenceDataBulk
function getReferenceDataBulk(string[] calldata _bases, string[] calldata _quotes) external view returns (ReferenceData[] memory);
/// Similar to getReferenceData, but with multiple base/quote pairs at once.
NatSpecSingleLine
v0.5.16+commit.9c3226ce
None
bzzr://965d58d136a2d2b672f47392ba5bcf943b07b0ac3c71394ddca409af88102ce8
{ "func_code_index": [ 697, 831 ] }
23,653
TheCollector
TheCollector.sol
0x02a91f038df34ce8285a9fa2e583db3a0b020b44
Solidity
TheCollector
contract TheCollector{ using SafeMath for uint; address payable public owner; address public weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address public Unft = 0xC36442b4a4522E871399CD717aBDD847Ab11FE88; uint256 public fee = 100; // amount 100 * feeRep 100 / 1000 = 10% Fee constructor() ...
withdraw
function withdraw() public payable onlyOwner{ owner.transfer( address( this ).balance ); }
//Safety onlyOwner functions for recovery of mistakes and fees
LineComment
v0.6.2+commit.bacdbe57
None
ipfs://6ac3cf7ae6142029285bd8f3b04f01d9541a4c9fa9a959da9d5582e98fd813dc
{ "func_code_index": [ 2733, 2839 ] }
23,654
WellethToken
WellethToken.sol
0x353586ca2e421a3310a7680cbcea9c47f1567fb6
Solidity
SafeMath
library SafeMath { /** * Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * Integ...
/** * @title SafeMath */
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; }
/** * Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://7d8cab5f74de50e1f6da590c49d31684f1de71c314db91d76e23ed2af9c51294
{ "func_code_index": [ 90, 297 ] }
23,655
WellethToken
WellethToken.sol
0x353586ca2e421a3310a7680cbcea9c47f1567fb6
Solidity
SafeMath
library SafeMath { /** * Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * Integ...
/** * @title SafeMath */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; }
/** * Integer division of two numbers, truncating the quotient. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://7d8cab5f74de50e1f6da590c49d31684f1de71c314db91d76e23ed2af9c51294
{ "func_code_index": [ 382, 682 ] }
23,656
WellethToken
WellethToken.sol
0x353586ca2e421a3310a7680cbcea9c47f1567fb6
Solidity
SafeMath
library SafeMath { /** * Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * Integ...
/** * @title SafeMath */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
/** * Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://7d8cab5f74de50e1f6da590c49d31684f1de71c314db91d76e23ed2af9c51294
{ "func_code_index": [ 797, 925 ] }
23,657
WellethToken
WellethToken.sol
0x353586ca2e421a3310a7680cbcea9c47f1567fb6
Solidity
SafeMath
library SafeMath { /** * Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * Integ...
/** * @title SafeMath */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; }
/** * Adds two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://7d8cab5f74de50e1f6da590c49d31684f1de71c314db91d76e23ed2af9c51294
{ "func_code_index": [ 990, 1136 ] }
23,658
Exclaim
Exclaim.sol
0x050acdfd31e0d1e76e97761ae3b078542c4354bd
Solidity
Exclaim
contract Exclaim is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
totalSupply
function totalSupply() public override view returns (uint) { return _totalSupply - balances[address(0)]; }
// ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------
LineComment
v0.6.6+commit.6c089d02
None
ipfs://b45d1e8fc0b5842d87dd37cd3eece00410317751aad9dc0db36390ee2131855d
{ "func_code_index": [ 982, 1107 ] }
23,659
Exclaim
Exclaim.sol
0x050acdfd31e0d1e76e97761ae3b078542c4354bd
Solidity
Exclaim
contract Exclaim is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
balanceOf
function balanceOf(address tokenOwner) public override view returns (uint balance) { return balances[tokenOwner]; }
// ------------------------------------------------------------------------ // Get the token balance for account tokenOwner // ------------------------------------------------------------------------
LineComment
v0.6.6+commit.6c089d02
None
ipfs://b45d1e8fc0b5842d87dd37cd3eece00410317751aad9dc0db36390ee2131855d
{ "func_code_index": [ 1327, 1461 ] }
23,660
Exclaim
Exclaim.sol
0x050acdfd31e0d1e76e97761ae3b078542c4354bd
Solidity
Exclaim
contract Exclaim is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
transfer
function transfer(address to, uint tokens) public override returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(msg.sender, to, tokens); return true; }
// ------------------------------------------------------------------------ // Transfer the balance from token owner's account to to account // - Owner's account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------
LineComment
v0.6.6+commit.6c089d02
None
ipfs://b45d1e8fc0b5842d87dd37cd3eece00410317751aad9dc0db36390ee2131855d
{ "func_code_index": [ 1805, 2096 ] }
23,661
Exclaim
Exclaim.sol
0x050acdfd31e0d1e76e97761ae3b078542c4354bd
Solidity
Exclaim
contract Exclaim is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
approve
function approve(address spender, uint tokens) public override returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; }
// ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account // ------------------------------------------------------------------------
LineComment
v0.6.6+commit.6c089d02
None
ipfs://b45d1e8fc0b5842d87dd37cd3eece00410317751aad9dc0db36390ee2131855d
{ "func_code_index": [ 2374, 2596 ] }
23,662
Exclaim
Exclaim.sol
0x050acdfd31e0d1e76e97761ae3b078542c4354bd
Solidity
Exclaim
contract Exclaim is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
transferFrom
function transferFrom(address from, address to, uint tokens) public override returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(from, to, tokens...
// ------------------------------------------------------------------------ // Transfer tokens from the from account to the to account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the from account and // - From account must have sufficient balance to transfer // - S...
LineComment
v0.6.6+commit.6c089d02
None
ipfs://b45d1e8fc0b5842d87dd37cd3eece00410317751aad9dc0db36390ee2131855d
{ "func_code_index": [ 3127, 3499 ] }
23,663
Exclaim
Exclaim.sol
0x050acdfd31e0d1e76e97761ae3b078542c4354bd
Solidity
Exclaim
contract Exclaim is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
allowance
function allowance(address tokenOwner, address spender) public override view returns (uint remaining) { return allowed[tokenOwner][spender]; }
// ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------
LineComment
v0.6.6+commit.6c089d02
None
ipfs://b45d1e8fc0b5842d87dd37cd3eece00410317751aad9dc0db36390ee2131855d
{ "func_code_index": [ 3782, 3943 ] }
23,664
Exclaim
Exclaim.sol
0x050acdfd31e0d1e76e97761ae3b078542c4354bd
Solidity
Exclaim
contract Exclaim is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
approveAndCall
function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data); return true; }
// ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account. The spender contract function // receiveApproval(...) is then executed // --------------------------------------------------------------------...
LineComment
v0.6.6+commit.6c089d02
None
ipfs://b45d1e8fc0b5842d87dd37cd3eece00410317751aad9dc0db36390ee2131855d
{ "func_code_index": [ 4298, 4636 ] }
23,665
Exclaim
Exclaim.sol
0x050acdfd31e0d1e76e97761ae3b078542c4354bd
Solidity
Exclaim
contract Exclaim is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
transferAnyERC20Token
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); }
// ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------
LineComment
v0.6.6+commit.6c089d02
None
ipfs://b45d1e8fc0b5842d87dd37cd3eece00410317751aad9dc0db36390ee2131855d
{ "func_code_index": [ 4871, 5060 ] }
23,666
BlueSparrow
Ownable.sol
0x4d67edef87a5ff910954899f4e5a0aaf107afd42
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); ...
owner
function owner() public view returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b3d6256c48fe6fcc106aca14bf66c21769c212a76d65e8310f9e605aefa1789e
{ "func_code_index": [ 489, 573 ] }
23,667
BlueSparrow
Ownable.sol
0x4d67edef87a5ff910954899f4e5a0aaf107afd42
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); ...
renounceOwnership
function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); }
/** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b3d6256c48fe6fcc106aca14bf66c21769c212a76d65e8310f9e605aefa1789e
{ "func_code_index": [ 1131, 1284 ] }
23,668
BlueSparrow
Ownable.sol
0x4d67edef87a5ff910954899f4e5a0aaf107afd42
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); ...
transferOwnership
function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
/** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b3d6256c48fe6fcc106aca14bf66c21769c212a76d65e8310f9e605aefa1789e
{ "func_code_index": [ 1434, 1683 ] }
23,669
NexyZero
NexyZero.sol
0x63e66571a6936b23e03b82a44306409d9f0afe32
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. ...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; ...
/** * @dev Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://46bc91f59454d2aeaef4f92e5e3e5fb52b5253aca4a65db00c92ee1501050589
{ "func_code_index": [ 99, 534 ] }
23,670
NexyZero
NexyZero.sol
0x63e66571a6936b23e03b82a44306409d9f0afe32
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. ...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; }
/** * @dev Integer division of two numbers, truncating the quotient. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://46bc91f59454d2aeaef4f92e5e3e5fb52b5253aca4a65db00c92ee1501050589
{ "func_code_index": [ 628, 916 ] }
23,671
NexyZero
NexyZero.sol
0x63e66571a6936b23e03b82a44306409d9f0afe32
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. ...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
/** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://46bc91f59454d2aeaef4f92e5e3e5fb52b5253aca4a65db00c92ee1501050589
{ "func_code_index": [ 1040, 1171 ] }
23,672
NexyZero
NexyZero.sol
0x63e66571a6936b23e03b82a44306409d9f0afe32
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. ...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; }
/** * @dev Adds two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://46bc91f59454d2aeaef4f92e5e3e5fb52b5253aca4a65db00c92ee1501050589
{ "func_code_index": [ 1245, 1391 ] }
23,673
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */
NatSpecMultiLine
tryAdd
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } }
/** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 161, 388 ] }
23,674
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */
NatSpecMultiLine
trySub
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } }
/** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 537, 736 ] }
23,675
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */
NatSpecMultiLine
tryMul
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // 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 ...
/** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 887, 1395 ] }
23,676
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */
NatSpecMultiLine
tryDiv
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } }
/** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 1547, 1747 ] }
23,677
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */
NatSpecMultiLine
tryMod
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } }
/** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 1909, 2109 ] }
23,678
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 2352, 2455 ] }
23,679
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 2734, 2837 ] }
23,680
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; }
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 3092, 3195 ] }
23,681
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; }
/** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 3492, 3595 ] }
23,682
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consu...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 4058, 4161 ] }
23,683
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */
NatSpecMultiLine
sub
function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterp...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 4636, 4881 ] }
23,684
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */
NatSpecMultiLine
div
function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } }
/** * @dev Returns the integer division of two unsigned integers, reverting 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 ...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 5375, 5619 ] }
23,685
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
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
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 609, 838 ] }
23,686
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
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
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 918, 1179 ] }
23,687
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
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
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 1251, 1369 ] }
23,688
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
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
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 1442, 1680 ] }
23,689
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
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) { _removeTokenFromOwnerEnum...
/** * @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, ``...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 2289, 2884 ] }
23,690
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
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
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 3181, 3407 ] }
23,691
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
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
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 3604, 3773 ] }
23,692
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
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...
/** * @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
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 4396, 5393 ] }
23,693
nftCryptoGems
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x44cc59bde0dea5f928bc25c71a3191a0693670aa
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 = _all...
/** * @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
MIT
ipfs://b62ec4a057760cf02cabcb6c7ef003900b3b219426b70a0d5ccab69b1f961b23
{ "func_code_index": [ 5684, 6772 ] }
23,694
BlueSparrow
SafeMath.sol
0x4d67edef87a5ff910954899f4e5a0aaf107afd42
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b3d6256c48fe6fcc106aca14bf66c21769c212a76d65e8310f9e605aefa1789e
{ "func_code_index": [ 259, 445 ] }
23,695
BlueSparrow
SafeMath.sol
0x4d67edef87a5ff910954899f4e5a0aaf107afd42
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b3d6256c48fe6fcc106aca14bf66c21769c212a76d65e8310f9e605aefa1789e
{ "func_code_index": [ 723, 864 ] }
23,696
BlueSparrow
SafeMath.sol
0x4d67edef87a5ff910954899f4e5a0aaf107afd42
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b3d6256c48fe6fcc106aca14bf66c21769c212a76d65e8310f9e605aefa1789e
{ "func_code_index": [ 1162, 1359 ] }
23,697
BlueSparrow
SafeMath.sol
0x4d67edef87a5ff910954899f4e5a0aaf107afd42
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b3d6256c48fe6fcc106aca14bf66c21769c212a76d65e8310f9e605aefa1789e
{ "func_code_index": [ 1613, 2089 ] }
23,698
BlueSparrow
SafeMath.sol
0x4d67edef87a5ff910954899f4e5a0aaf107afd42
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to reve...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
None
ipfs://b3d6256c48fe6fcc106aca14bf66c21769c212a76d65e8310f9e605aefa1789e
{ "func_code_index": [ 2560, 2697 ] }
23,699